2023-08-28 04:20 AM
I can't flash hex/elf file with my compiled program via UART bootloader, using CubeProgrammer CLI.
During the download, there occurs an error:
"Write address was not acknowledged 0x20000000"
and downloading stops.
The project I'm flashing has a few RAM sections added in linker script:
/* used for thread stacks */
.thread_stack :
{
. = ALIGN(4);
. = ABSOLUTE(0x20000000); /* start addres for thread stack area */
*(.ThreadStackSection) /* thread stacks section name */
. = ALIGN(4);
} >DTCMRAM
/* used for network buffers */
.net_buff :
{
. = ALIGN(4);
. = ABSOLUTE(0x2001D800); /* start addres for Tx/Rx network buffers area */
*(.NetworkBufferSection) /* netowrk buffers section name */
. = ALIGN(4);
} >DTCMRAM
/* used for storing network packets (NetXDuo packet pool) */
.nx_section 0x24000000 (NOLOAD):
{
*(.NetXPoolSection)
} > RAM_D1
/* used for events recording (TraceX) */
.trace :
{
. = ALIGN(4); /* start addres for trace buffer */
*(.TraceSection) /* trace buffer section name */
. = ALIGN(4);
} > RAM_D1
I guess these sections cause the problem, because that's the only difference between my linker script and one generated with new project. (I am able to program blank new project just fine).
Is there any possibility to make this project bootloadable?
2023-08-28 05:17 AM
Tread stacks and network buffers shouldn't need to be stored in the hex file. Mark those sections as NOLOAD.
It's unclear if DTCMRAM is a valid address for bootloader commands.
2023-08-28 05:44 AM
As I recall there's a section of RAM that's not available as it's used by the ROM's code. Check docs for KEEP OUT areas
Perhaps create an image that can unpack itself via startup.s style code, like it normally does with FLASH images, and don't have uninitialized sections with data behind them. Check ELF dump for appropriate NOBITS sections.