Hi,
I am trying to flash 2 .elf files to S32K116 using pegdb console, bootloader.elf and app.elf.
Here are the steps I am following:
Start the gdb server with command "pegdbserver_console.exe -startserver -device=NXP_S32K1xx_S32K116F128M4"
Then using the arm-none-eabi-gdb.exe, I connect to S32K116 and try to flash .elf files with command "arm-none-eabi-gdb.exe --command=load_sw.txt"
Content of load_sw.txt is:
set style enabled off
file bootloader.elf
target remote localhost:7224
set pagination off
echo \n \t [OK] STEP-1 : CONNECTED TO DEVICE \n
load bootloader.elf
echo \n \t [OK] STEP-2 : FLASHED BOOTLOADER \n
load app.elf
echo \n \t [OK] STEP-3 : FLASHED APPLICATION \n
continue
quit
When the command are executed I can only see application running since bootloader does not prints its logs. My guess is I am missing something so the app.elf overrides the memory region. You can see the memory regions defined in .ld files
applications memory areas :
MEMORY
{
/* Flash */
m_interrupts (RX) : ORIGIN = 0x0000C000, LENGTH = 0x000000C0
m_flash_config (RX) : ORIGIN = 0x0000C200, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x0000C210, LENGTH = 0x00013FFF
/* SRAM_L */
m_custom (RW) : ORIGIN = 0x1FFFFC00, LENGTH = 0x00000400
/* SRAM_U */
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x000020C0
m_data_2 (RW) : ORIGIN = 0x200020C0, LENGTH = 0x00001740
}
-------
bootloaders memory areas:
MEMORY
{
/* Flash */
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x000000C0
m_flash_config (RX) : ORIGIN = 0x00000200, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00000210, LENGTH = 0x00000BBEF
/* SRAM_L */
m_custom (RW) : ORIGIN = 0x1FFFFC00, LENGTH = 0x00000400
/* SRAM_U */
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x000020C0
m_data_2 (RW) : ORIGIN = 0x200020C0, LENGTH = 0x00001740
}
What could be the problem in your opinion on the issue?
Is there something I am missing to keep the first loaded .elf's memory region in the module or am I making a mistake in specifying the memory regions?
Thank you for your help and interest!
Regards,
Furkan
Solved! Go to Solution.
Hi,
unfortunately gdb server/client if used from console performs flash erase for each load .elf file command. It means, that only the last .elf file remains in flash memory. Here is article related to this topic - https://mcuoneclipse.com/2022/11/01/loading-multiple-binary-files-with-gdb/.
Hi,
unfortunately gdb server/client if used from console performs flash erase for each load .elf file command. It means, that only the last .elf file remains in flash memory. Here is article related to this topic - https://mcuoneclipse.com/2022/11/01/loading-multiple-binary-files-with-gdb/.
Hello,
Thank you for the information!
Regards,
Furkan