Hello,
I'm trying to flash hex file into into Flexspi flash as a secondary application (the first one is bootloader that actually should flash a hex).
I'm a little bit disappointed with the addresses, for example the first line of hex file is
:020000042000DA
and a Linear Address is 0x20000000.
How do I translate this into flash offset (let's say 0x40000)?
Is there any sample of hex file record parsing and flashing?
Thank you in advance.
Hi @yanz ,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Firstly, I'd like to know whether you can introduce the source of the HEX file, next, the HEX should be converted into a BIN file prior to being programmed to the flash, for the i.MX RT series MCU, you can use the tool to do convert job.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Thank you for your response.
Out team is working with MCUExpresso IDE.
Hi @yanz ,
Thanks for your reply, even though I'm still not very clear about your purpose.
1) According to your statement, you want to know the steps of generating the HEX file with a specific offset from the flash start address, if my understanding is right, you can follow the below steps to do it.
1) Modify the memory map;
2) Then build the demo again to generate the AXF file;
3) Last, generate the HEX file just as the figure shows.
2) Is HEX file above that burned into well-known location must be bootable?
-- It depends on the type of MCU, so what MCU do you use?Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Thank for your response.
1. How do I modify memory map? - this info is unclear for me.
2. We're using imxrt1050.
Hi @yanz ,
Thanks for your reply.
My mean is you should modify the linker file if you want the image to have a specific offset from the flash start address, so please refer to the user guide of the MCUXpresso to do it.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
I have my own bootloader (bootable application on external flash, burned with MCU boot utility, loads up and works). Bootloader is HID USB app that's communicating with the host application. Host parses .hex file and sends the data to bootloader for flashing (or jumping to previously flashed file). Hex file generated from evkbimxrt1050_flash_component_nor sample and has no flash in his memory map. Hex file has the following extended address:
:020000042000DA (2000 is an upper 16 bit in address). After parsing, I have Programming Address Hex:0x20002000 and it doesn't match any flash address or offset.
I want to flash hex file to BOOT_FLASH_CAND_APP. How do I deal with Hex:0x20002000? Ignore? Translate? Any other definition in project settings that will lead to desired flash offset?
#define BOOT_FLASH_BASE 0x60000000
#define BOOT_FLASH_ACT_APP 0x60040000
#define BOOT_FLASH_CAND_APP 0x60240000
#define FLASH_AREA_IMAGE_1_OFFSET (BOOT_FLASH_ACT_APP - BOOT_FLASH_BASE)
#define FLASH_AREA_IMAGE_1_SIZE (BOOT_FLASH_CAND_APP - BOOT_FLASH_ACT_APP)
#define FLASH_AREA_IMAGE_2_OFFSET (FLASH_AREA_IMAGE_1_OFFSET + FLASH_AREA_IMAGE_1_SIZE)
#define FLASH_AREA_IMAGE_2_SIZE FLASH_AREA_IMAGE_1_SIZE // image2 slot is the same size as image1
#define FLASH_AREA_IMAGE_3_OFFSET (FLASH_AREA_IMAGE_2_OFFSET + FLASH_AREA_IMAGE_2_SIZE)
Hi,
Thanks for your reply.
1) Any other definition in project settings that will lead to desired flash offset?
-- Please refer to the link to generate the image that should reside in the external nor flash.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Note that external flash is used (not in memory map).
Would be possible that you tell us the part number that is used?
Is the imxrt500 the device that you are using?
Can you share with us in more detail about your problem?
Sure.
I have my own bootloader (bootable application on external flash, burned with MCU boot utility, loads up and works). Bootloader is HID USB app that's communicating with the host application. Host parses .hex file and sends the data to bootloader for flashing (or jumping to previously flashed file). Hex file generated from evkbimxrt1050_flash_component_nor sample and has no flash in his memory map. Hex file has the following extended address:
:020000042000DA (2000 is an upper 16 bit in address). After parsing, I have Programming Address Hex:0x20002000 and it doesn't match any flash address or offset.
I want to flash hex file to BOOT_FLASH_CAND_APP. How do I deal with Hex:0x20002000? Ignore? Translate? Any other definition in project settings that will lead to desired flash offset?
#define BOOT_FLASH_BASE 0x60000000
#define BOOT_FLASH_ACT_APP 0x60040000
#define BOOT_FLASH_CAND_APP 0x60240000
#define FLASH_AREA_IMAGE_1_OFFSET (BOOT_FLASH_ACT_APP - BOOT_FLASH_BASE)
#define FLASH_AREA_IMAGE_1_SIZE (BOOT_FLASH_CAND_APP - BOOT_FLASH_ACT_APP)
#define FLASH_AREA_IMAGE_2_OFFSET (FLASH_AREA_IMAGE_1_OFFSET + FLASH_AREA_IMAGE_1_SIZE)
#define FLASH_AREA_IMAGE_2_SIZE FLASH_AREA_IMAGE_1_SIZE // image2 slot is the same size as image1
#define FLASH_AREA_IMAGE_3_OFFSET (FLASH_AREA_IMAGE_2_OFFSET + FLASH_AREA_IMAGE_2_SIZE)
Thank for your response.
The problem is described above.
1. How do I modify memory map? - this info is unclear for me.
2. We're using imxrt1050.