Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

XMC™ Forum Discussions

Not applicable
Hi,

I want to develop boot loader for project(Field firmware upgrade) on XMC1400 controller.I am working on XMC 1400 Dev. Kit.

Anyone please guide me in this prospective.







Thanks & regards,

M. Ramarao.
0 Likes
11 Replies
chismo
Employee
Employee
First like received
Hello M. Ramarao,

There is an Application note related to this that you might want to have a look:
http://www.infineon.com/dgdl/Infineon-TOO_XMC1000_Boot_Modes_Example_Code-AN-v01_03-EN.exe?fileId=db...

Regards,
Min Wei
0 Likes
Not applicable
Hi Min Wei,

Thanks for your reply.But i am not able to view that sample code. As a .exe file, it is not giving any file.Please help me on this and guide me for following the step by step process.


Thanks & Regards,

M. Ramarao.
0 Likes
chismo
Employee
Employee
First like received
Hello Ramarao,

Sorry I missed your reply on the problem with downloading the file.
But can I confirm that when you click on the button "Accept and Open" on the subsequent page with agreement on use of the document/SW, you do not get a dialog box to save the file, which is actually a zip file?

I saw that you have posted on implementing a SPI boot loader with SD Card interface. Since those threads are quite old, I will simply use this one to comment.

I got to admit that I have not tried implementing such a boot loader before, but I should be able to support you from the device point of view.
Obviously you must first be able to interface to the SD card through the SPI. Are you able to do this already?

From the boot loader and device perspective, then there should be a means of reading blocks of data from the SD Card into the SRAM, and triggering the Flash erase (if necessary) and program.
Since the XMC1400 SPI is the master, it can decide when to read the subsequent blocks of data after the current ones have been successfully programmed.
So in this aspect, the handshaking between XMC1400 and the SD Card is much easier, compared to the ASC-based implementation.

Regards,
Min Wei
0 Likes
Not applicable
Hi Min Wei,

Thanks for your reply and as per my knowledge to write or read some data into the SD card, Supoorted FAT file system is needed. I am trying to implement that FAT file system for this communication.

But i am not able to reach it exactly.Please guide me to implement this thing first for communication between SD card and XMC 1400.

Thanks & Regards,

M.Ramarao.
0 Likes
Not applicable
Hi Min Wei,

As per above mentioned process for boot loader, after power on reset i want to read the file from SD card and want to store it in Flash either by overwriting old firmware or by making a new location for

new firmware.My primary concern should be not to disturb the old firmware, if any problem occurs in the update process.Please guide me for this implementation.


Thanks,

M. Ramarao.
0 Likes
Not applicable
M. Ramarao,

I and a colleague have also tried the executable recommended by Min Wei and we have also experienced the fact the executable does not work.

Steve.
0 Likes
chismo
Employee
Employee
First like received
Hello M. Ramarao, Steve,

As the original zip file is too big, I have split them into smaller files and attached as follows:

Folder for PC host program "XMC1x_Load", to be located under the main folder \..\XMC1000_ASCBootloader\:

Sub-folder ipch, to be located inside folder \..\XMC1000_ASCBootloader\XMC1x_Load\


DAVE projects \..\XMC1000_ASCBootloader\DAVE4\


Application note (pdf file):


Regards,
Min Wei
0 Likes
chismo
Employee
Employee
First like received
Hello M. Ramarao,

Regarding the boot loader program, you need to partition the Flash memory into at least 2 areas.

The 1st area with the Flash start address can be used for the application code including interrupt handlers. It should have also the capability to detect the trigger for the boot loader mode and jump to the 2nd area containing the boot loader.
If the boot loader mode is always entered after a reset, you can use a simple jump.

The 2nd area as mentioned, will be for the boot loader. Ideally, the actual sequence to program/erase the Flash should be further copied to the SRAM and executed from there.
As to how to read the SD card via the SPI, for sure this is possible but I have not tried too.
I believe one way is to use the FATFS DAVE app and I am trying to get an example code for the app. Currently the examples are all based on XMC4500, which has a SDMMC module.

Regards,
Min Wei
0 Likes
Not applicable
Hi Minwei,

Two important corner cases for me in this process are 1.Overwriting the flash with new firmware

2. Having backup for old firmware and running the new firmware.

While field firmware upgrade through SD card, if anything goes bad in the middle of the process then my old firmware should be safe and it has work as it is with the old firmware. Please guide me for this

safe boot loader implementation.
0 Likes
Not applicable
Hi Minwei,

Thanks for your concern and reply.As i mentioned above, i feel second cases will be the better option for my product. Please suggest me in this implementation and kindly guide me for

further steps.


Thanks & Regards,

M. Ramarao.
0 Likes
chismo
Employee
Employee
First like received
Hello again,

I have just found out that the same usage example given in the APP help document, which is based on XMC4500, can be fully reused with XMC1000.
Therefore the steps are:
1) Add FATFS APP instance (no re-configuration needed since by default, SPI mode is already selected)
2) Select the required SPI pins
3) Generate code
4) Replace main.c with usage example code
5) Run the code

Of course, the above assumes you have already connected physically a SD Card board to XMC1000 device.

Regards,
Min Wei
0 Likes