Smart Snippets Download to Flash failed

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
16 posts / 0 new
Last post
caiziee
Offline
Last seen:2年5个月前
Joined:2016-07-29 10:01
Smart Snippets Download to Flash failed

Hi, Dialog

I am using DA14583, and when I use Smart Snippets to download my hex file, it shows that Read 0 bytes from file XX.hex, XXX bytes have been ignored 'because their record address was greater or equal to 0x8000'.

This blocks my development, Could you help me please? Thanks a lot.

Keywords:
Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi caiziee,

Hi caiziee,

Can you please give me some more information, what you are trying to do ? Burn the flash, the OTP, download via UART? This messages appears when you are trying to do what exactly ? Browse to the "Select File to download" field, burn the memory? What interface you are using (UART, JTAG) ? The .hex file that you are using, how it is generated and how big it is ? And which version of the Smart Snippets studio are you using ?

Thanks MT_dialog

caiziee
Offline
Last seen:2年5个月前
Joined:2016-07-29 10:01
Sorry, my fault, I should

Sorry, my fault, I should provide more information.

I am using Jtag interface to burn the internal 1MB flash. When I brows to the download file, it cannot be opened then I got this error message. The hex file is build by Keil 5. We add our own application into the ble_example project. The hex file size is 103KB. I am using Smart Snippets 3.9.
The generated map file is as below:
==============================================================================

Code (inc. data) RO Data RW Data ZI Data Debug

31936 3532 4656 584 11152 972004 Grand Totals
31936 3532 4656 584 11152 972004 ELF Image Totals
31936 3532 4656 584 0 0 ROM Totals

==============================================================================

Total RO Size (Code + RO Data) 36592 ( 35.73kB)
Total RW Size (RW Data + ZI Data) 11736 ( 11.46kB)
Total ROM Size (Code + RO Data + RW Data) 37176 ( 36.30kB)

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi caizee,

Hi caizee,

Since you are trying to burn a fairly large file in the 583, there seems to be a check in Smart Snippets when you are browsing a .hex file that is larger than a certain default value, try converting your .hex file into a .bin file, after doing that Smart Snippets will accept it, then try to burn it to the flash of the 583.

Thanks MT_dialog

caiziee
Offline
Last seen:2年5个月前
Joined:2016-07-29 10:01
Thanks for your reply.

Thanks for your reply.
But I have tried this and get the bin files using fromelf.exe. But what I got is not one bin file, but several bin files. They are
ER_IROM1 1KB
ER_IROM2 1KB
ER_IROM3 1KB
ER_IROM4 1KB
ER_IROM5 36KB
ZI_RET20 1KB

I do not know how to burn these bin files into flash at the exact addresses?

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi caiziee,

Hi caiziee,

In a previous SDK release that you should be able to find online (in the Previous Software Releases section of the Software and tools tab) we include a hex2bin utility that it should be able to convert you .hex file into an appropriate .bin file in order to you to place it in Smart Snippets. For example in the SDK5.0.3, you will be able to find the hex2bin in the utilities/flash_programmer folder. Also you will be able to find it, in the tutorials section in the Tutorial 6: SUOTA TOOL ZIP FILE.

Thanks MT_dialog

caiziee
Offline
Last seen:2年5个月前
Joined:2016-07-29 10:01
Hi, Dialog

Hi, Dialog
Thanks for your quick reply.
I have tried this, but it failed.
Because in our application, there are many parts which are defined in scatter config file. The address are not continuous. When I use the hex2bin.exe, I got this output:
Lowest address = 00000000
Highest address = 00080857
Pad Byte = FF
8-bit Checksum = 9C
当我用智能片段闪过,我得到了一个error "Size of data of selected file plus offset exceeds SPI FLASH memory size (131072 bytes)".

Could you please give me more hints about this? Thank you in advance.

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi caiziee,

Hi caiziee,

Apparenty its not something related with Smart Snippets, i assume that the .bin that the .hex produces is very large for the flash, if your .hex applies a padding and the .bin reaches a very large size there is something wrong with the scatterfile or you have applied a fixed initialized value somewhere in your fw that the linker isn't able to handle properly (add some code in order to initialize it) hence it results in a very large .bin file since in order to apply the value it writes it in the corresponding address in the binary instead of applying it by using extra code.

Thanks MT_dialog

caiziee
Offline
Last seen:2年5个月前
Joined:2016-07-29 10:01
Thanks, Dialog.

Thanks, Dialog.
The scatter config file defines several spaces, and I did a little change based on the sdk 5.0.5 ble_example project. In order to get more ram space for code RO and Data RO, I rearrange the ram setting. Could you help check it please? Before I added some new features in our project, this can work well using .hex flashing. But after the size gets larger, I was stuck by this problem.
For some big array initialization, I declare them as '__attribute__((section("retention_mem_area0"),zero_init)); ' to put them in the retention ram.

-----------------------------------------------------------------------------------------------------------------------------

# !armcc - e -我,\.\..,.\..\src\config,.\..\..\sdk\common_project_files\ --cpu Cortex-M0

#include "da1458x_config_basic.h"
#include "da1458x_config_advanced.h"
#include "da1458x_scatter_config.h"

; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
;
; This scatter file is set up for EM_MAP == 23!
; If an application uses a different memory layout then it must
; use a customized scatter file.
;**************************************************************

LR_IROM1 0 x20000000 0 x160 {;负荷地区size_region
ER_IROM1 0x20000000 0x160 { ; load address = execution address
*.o (RESET, +First)
}
}

LR_IROM2 0x20000160 0x160 {
ER_IROM2 0x20000160 0x160 {
* (jump_table_mem_area)
}
}

LR_IROM3 0x200002C0 0x80 {
ER_IROM3 0x200002C0 0x80 {
* (timeout_table_area)
}
}

LR_IROM4 0x20000340 0x100 {
ER_IROM4 0x20000340 0x100 {
* (nvds_data_storage_area)
}
}

LR_IROM5 0x20000440 0x93c0 {
ER_IROM5 0x20000440 0x8dc0 {
*(InRoot$$Sections) ; All library sections that must be in a
; root region, for example, __main.o,
; __scatter*.o, __dc*.o, and * Region$$Table
boot_vectors.o (+RO)
system_ARMCM0.o (+RO)
;*armlib* (+RO)
.ANY (+RO)
.ANY (+ RW)
}

RW_IRAM54 0x20009200 UNINIT 0x600 { ; Stack
.ANY (STACK)
}

}

LR_RETENTION_RAM2 0x00080768 0x2898 {
; Extended Sleep mode
; Extended RetRAM : 0x80000 - 0x83000
ZI_RET20 0x00080768 UNINIT 0x22b8 { ; 0x80768 is the last address used by the ROM code
#if (BLE_CONNECTION_MAX_USER > 4)
arch_system.o (cs_area)
#endif
jump_table.o (heap_env_area)
jump_table.o (heap_db_area)
jump_table.o (heap_msg_area)
.ANY (retention_mem_area0) ; application data
.ANY (+ZI)
#if defined(SPOTAR_PATCH_AREA) && (SPOTAR_PATCH_AREA == 1)
app_spotar.o (spotar_patch_area) ; Placed in the SysRAM when SPOTAR_PATCH_SYSRAM is 1
#endif
}

ZI_RET21 EXCHANGE_MEMORY_BASE EXCHANGE_MEMORY_SIZE {
arch_main.o (BLE_exchange_memory)
}
}
#endif

;LR_GUARD_RAM 0x50000000 0x0 {
;RW_GRAM0 0x50000000 0x0 { ; Make sure that nothing has been placed in here!
;*.o (exchange_mem_case1)
;}
;}

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi caizee,

Hi caizee,

What i can see in the scatter that you have provided is that you have ommited some areas from the original scatter file as illustrated in this post (https://support.dialog-semiconductor.com/how-build-program-code-larger-32kb) but you also ommited RW_IRAM52 and RW_IRAM53 which is not suggested and also by ommiting the RW_IRAM51 area you dont indicate the area of replacement as indicated by the previous post. I am not able to tell how the keil will react in the scatter file that you have attached. If via using this scatterfile the fw used to run but after adding some additional code the binary produced is too large then perhaps you initialize some variables that you have placed in the retention ram, and that causes the .bin file to be that large. Also it will be helpfull if you could provide the map file of the project and the .hex file to have a look.

Thanks MT_dialog

caiziee
Offline
Last seen:2年5个月前
Joined:2016-07-29 10:01
Hi, Dialog

Hi, Dialog
Thanks for your reply so much.
And as you mentioned, I declare a constant array with initialization numbers, but I put it in retention ram area 0. Will this cause the problem? I also read carefully UM-B-011 file, it said that
'The area 0x80000 to 0x82FFF should be declared as one that contains data that do not have to be initialized (UNINIT).'

caiziee
Offline
Last seen:2年5个月前
Joined:2016-07-29 10:01
Hi, Dialog

Hi, Dialog
One more question, the OTP is 32KB. And after booting up, OTP mirror the application code to ram. But I would like to know that what kind of data will OTP mirror? Code RO or Code RO+DATA RO, or something else?
Thanks a lot.

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi caiziee,

Hi caiziee,

Yes that might cause the problem that you are facing and the linker produces a large .hex file, regarding the reference that you ve made in the UM-B-011, yes it mentions that the specifiic area remains UNINIT since the specified area is zero initialized by the SDK it self upon starting.

Regarding the OTP and what is mirrored, the entire image is mirrored from the OTP in the sysram, there is no interaction between the image section and the OTP while the fw is running.

Thanks MT_dialog

caiziee
Offline
Last seen:2年5个月前
Joined:2016-07-29 10:01
Thanks, I have done a quick

Thanks, I have done a quick experiment to approve this. Yes, when I put all const value out of retention ram, the binary changes to be small.
Then when I use case 23, what is the limitation for Code RO + DATA RO +RW RO?
Thanks a lot for your reply.

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi caiziee,

Hi caiziee,

The sysram when case 23 mapping is used is 38KB.

Thanks MT_dialog

caiziee
Offline
Last seen:2年5个月前
Joined:2016-07-29 10:01
Thank you very much, Dialog.

Thank you very much, Dialog. You really did a great help for my issue. It is quite nice to get so wonderful support from your side. ;-)

Topic locked