Can`t compile project with a custom flash start address

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can`t compile project with a custom flash start address

1,988 Views
Stelsing
Contributor I

Hello, i use a JN5189 MCU and i need to use a bootloader with main application. But when i change a start flash address in main application to 0x5000 i got a compile error:

"Writing checksum 04038ad0 to file jn5189dk6_main.axf
Writing CRC32 of header a0c73ea3 to file jn5189dk6_main.axf
Binary size is 000054b4 (21684)
File size 21684 different from expected 42164

arm-none-eabi-objcopy: 'jn5189dk6_main.axf': No such file"

After this i found a variant of solution - disable autogenerate linker files and change start address by hand, but also had a same problem

My linker file:

MEMORY
{
/* Define each memory region */
PROGRAM_FLASH (rx) : ORIGIN = 0x5000, LENGTH = 0x9b000 /* 630K bytes (alias Flash) */
SRAM (rwx) : ORIGIN = 0x4000000, LENGTH = 0x15fe0 /* 90080 bytes (alias RAM) */
SRAM1 (rwx) : ORIGIN = 0x4020000, LENGTH = 0x10000 /* 64K bytes (alias RAM2) */
}

/* Define a symbol for the top of each memory region */
__base_PROGRAM_FLASH = 0x5000 ; /* PROGRAM_FLASH */
__base_Flash = 0x5000 ; /* Flash */
__top_PROGRAM_FLASH = 0x5000 + 0x9b000 ; /* 630K bytes */
__top_Flash = 0x5000 + 0x9b000 ; /* 640K bytes */
__base_SRAM = 0x4000000 ; /* SRAM */
__base_RAM = 0x4000000 ; /* RAM */
__top_SRAM = 0x4000000 + 0x15fe0 ; /* 90080 bytes */
__top_RAM = 0x4000000 + 0x15fe0 ; /* 90080 bytes */
__base_SRAM1 = 0x4020000 ; /* SRAM1 */
__base_RAM2 = 0x4020000 ; /* RAM2 */
__top_SRAM1 = 0x4020000 + 0x10000 ; /* 64K bytes */
__top_RAM2 = 0x4020000 + 0x10000 ; /* 64K bytes */

 

Can you help me? What did I do wrong?

thanks

Tags (1)
0 Kudos
6 Replies

1,683 Views
ReinierG
Contributor I

I'm strungling with a similar problem for the K32W061. However, when I modified the python script dk6_image_tool.py (around line 500):

if out_file_sz != img_total_len:
    print("File size %d different from expected %d" % (out_file_sz, img_total_len))
    # error = 1
return error

The error=1 is commented out. Now an .axf file is generated and it will be written at the flash offset you specified. The only other thing I changed was the flash address in the memory setting in the Project Explorer window. No manual editing of linker files.

0 Kudos

1,900 Views
Stelsing
Contributor I

Hello @mario_castaneda 

thanks for your reply. Yes, I want to update the Main application in my device with MCU JN5189. I have the same logic from another device, where the main firmware is updating from a remote server with a GSM modem.

I have tried using this instruction - https://mcuoneclipse.com/2019/10/06/linking-bootloader-applications-with-eclipse-and-freemarker-scri... but i got the same problem - "File size 21900 different from expected 42380"

I think the IDE use start address 0x0000 for result file size, not with offset 0x5000. Because expected size 42380 - offset (0x5000) = 21900 . But i dont know why

 

My memory map should be like this:

0x00000 - 0x05000 - Bootloader (20k)
0x05000 - 0xA0000 - Main program (635k)

0 Kudos

1,879 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @Stelsing,

Did you try with the JN-AN-1244 OTA update?

We provide an example that works with this process using the coordinator and sending the data over the air.

Are you working with the Zigbee Protocol?

Regards,

Mario

 

0 Kudos

1,869 Views
Stelsing
Contributor I

No, I didn't. Because I have a custom protocol for updating firmware from our server. For example, I have JN589 plus GSM modem with UDP connection for the coordinator. And when I need to update the firmware in coordinator a server would send me a few package with new firmware

yes, I try to work with Zigbee Protocol. But when I download a sample from SDK - the config tool doesn't work with Zigbee samples, but with other samples works well

0 Kudos

1,835 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @Stelsing,

yes, I try to work with Zigbee Protocol. But when I download a sample from SDK - the config tool doesn't work with Zigbee samples, but with other samples works well.

What were the examples that you had with the config tool?

I recommend trying with the Zigbee Protocol and the OTA Cluster.

Regards,

Mario

 

0 Kudos

1,911 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @Stelsing,

I hope you are doing great.

I am assuming that you want to update your device using the OTA and trying to update your application?

Is it possible that you could share more details about your application?

I could recommend some other examples or some feedback.

Regards,

Mario

0 Kudos