This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am trying to get BIM to work from external flash. If I understand the documentation correctly, the external flash layout consists of a table of external flash headers at each of the first N pages, followed by application images. Each EFH contains the location of the application code.
The BIM code calls isLastMetaData(), which looks at the first 8 bytes of each page and searches for two image IDs: "CC13x2R1" and "OAD IMG". If it finds "OAD IMG" it will return the flash page number and copy the image. If it finds CC13x2R1 it does nothing. When I run BIM it returns IMG_HDR_FOUND because the second check it true.
if(metadataIDCheck(&imgHdr) == true) /* External flash metadata found */ { return(flashPageNum); } else if(imgIDCheck(&imgHdr) == true) /* Image metadata found which indicate end of external flash metadata pages*/ { return(IMG_HDR_FOUND); }
The image that I have is a small contiki-ng application and has the following header:
Image Identification: CC13x2R
CRC: aa,5c,ae,4c
BIM Version: 3
Image Header Version: 1
Wireless technology: Easy Link
Image information: ff,ff,07,00
Image validation: ff,ff,ff,ff
Image length: 24,62,01,00
Program Entry Address: 00,01,00,00
Image Software Version: 00.04
Image End Address: 23,62,01,00
Header length: 2c,00
External Flash Address: ff,ff,03,bf
Counter / Timestamp: ff,ff,55,00
So I think the image is an application image without an entry in the external header table at the start of the flash. Is this correct? If so, how do I make the header table?
Thanks,
David
Hi David,
You can see a figure of the external flash memory layout here:
Starting from 0x00000000, the external flash starts with all the Image headers. After the headers you will find the actual images. At the end of external flash you will find a factory image.
How are you programming you image to the internal flash?
I don't understand you final question. Can you please rephrase?
Cheers,
Marie H
Thanks Marie.
Yes. I have seen this figure with the flash layout and it sounds like I have understood it. I am just trying to replicate it. I believe I have produced the actual image. But I don't have the image headers starting at 0x0000000. The question is how to I generate the table of image headers? Is there a tool/compiler flag to do this? Is there an example? Or is this just something I just have to construct by myself and write to the flash? Do I generate a single image with the image header starting at 0x00000000 and the actual application image? Or do I produce two images, one for the header and one for the application and upload them separately?
What's the correct procedure for doing this?
Thanks for your help.
Hi David,
Sorry for the delay,
Did you check how this is done in our off-chip OAD applications?
In this case, only one image is incoming at the time. Thus the header is first programmed, then the image itself.
Cheers,
Marie H
Part Number: LAUNCHXL-CC1312R1
I asked a question a while ago (Get BIM to copy image from external flash), which is now locked. I've had to work on other things, but now have to get this running.
I still don't understand how to do this. I have BIM installed and booting on the device.
The last post was "In this case, only one image is incoming at the time. Thus the header is first programmed, then the image itself."
If I can produce the header and the image itself, I can flash them to the device. The question is, how do I make the header? Of course, I could do this from scratch by writing a python or C program to put all the bytes to what I think should be the right values, based on "Table 12. Description of the core image header", and the extra fields for off-chip BIM, but I get the feeling there's an easier way than this. But I can't find an example. Or maybe there isn't one, and I really do have to build up this table by hand from scratch?
What would really help is a minimal application (blinky, or hello-world or something), with a Makefile that will produce the application image and header image that I can flash to my BIM enabled Launchpad, so that when it reboots it copies the new application to internal flash and runs it.
Hi David,
I unlocked and joined your two threads.
Yes please reference our off-chip OAD examples. The main changes compared to a non-oad example are:
- OAD image header file
- Linker change to accommodate BIM.
Cheers,
Marie H
Hi Marie,
This didn't help to resolve the issue. Perhaps you could respond to the specific questions:
a) Is there a mechanism to build the image header for external BIM images or do I have to create this myself from scratch? I am talking about the offchip image header table described in "External Flash Memory Layout".
b) Is the header uploaded as a separate file or is it included in the application image? Your response "Thus the header is first programmed, then the image itself" suggests there are two binary files to upload for the application, but the examples only specify how to generate the BIM application and the user application.
This would at least help me on to the next step. If there is a mechanism I can't find it. I have looked at the rfWsnNodeExtFlashOadClient and the sensor_oad_offchip_secure examples. Are these the best examples to look at?
The question I keep asking is that the external flash is shown in the diagram "The memory partition of the application for Off-chip OAD is depicted in below" under "flash-layout-off-chip.html". The image headers are shown in grey at the bottom of the memory map starting at 0x00000000. I need some advice on how to produce this header table because it's not clear to me from either the documentation or examples.
Thanks,
David
Hi David,
a) The external flash image header should be created by the application when the image is loaded to external flash. You can see the implementation in oad.c. More information about this header in the User's Guide:
b) The OAD image header is uploaded as part of the image (as part of the same .bin file). The external flash image header is created as a separate entity from the image when the image is programmed to the external flash.
I hope it's useful for you to look at oad.c and ext_flash_layout.h!
Cheers,
Marie H
Thank you Marie. This resolved the issue. I was looking for a mechanism as part of the build process, which of course doesn't exist.