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.
Hi Champs,
Is the configuration of flash control registers necessary for programming the flash on LF240xA devices?
One of my customer has been trying to analyse the boot code for LF240xA present in the Appendix D of the SPRU357c document and had the following doubt.
" From whole boot loader code the only instruction TBLW is the one, who is writing the flash, which is not enough as there are many things to do, other than this TBLW instruction i.e., clear algorithm, erase algorithm and configure the Memory Control Registers. The configuration of Memory Control Registers is missing in the code. How the firmware is programming the flash, without using the Flash Control Registers."
Please do let me know if his understanding is correct.
Regards,
Nikhil
Nikhil,
The bootloader DOES NOT program the flash. All the bootloader does is load a piece of code into on-chip RAM and run it from there.
In order to program the flash, the user must use a flash programming utility, for example the C2000 Flash plugin for CCS, or SDFlash (for a Spectrum Digital emulator). There are other utilities out there as well.
Regards,
David
Hi David,
Thanks for the information.
I was a bit confused when I was looking into the boot loader code available in the Appendix D of the SPRU357c document. Looking into the code I could understand that the using the TBLW instruction, code of size "length" is being copied to EEPROM. What is this code that is being copied to the program memory.
I feel that these questions might be a bit silly[:)] but please let me know if my understanding is correct as I am a bit confused with this.
Also, please direct me to some documents or weblinks which explain the boot loading process (from device reset to the board bring-up).
Regards,
Nikhil
Nikhil,
>> Looking into the code I could understand that the using the TBLW instruction, code of size "length" is being copied to EEPROM
The bootloader is copying from the SCI or SPI serial port to program memory space RAM. It cannot write to the internal flash. The first two words sent in on the serial port are destination address for the data, and the length of the block. The data then follows. The bootloader is seldom used. Almost all customers simply program the internal flash, and run their code from their at startup. The bootloader is really only used for in-field flash programming.
>> please direct me to some documents or weblinks which explain the boot loading process (from device reset to the board bring-up).
There really isn't anything other than the datasheet and user's guide. The bootloader is documented in the appendix of the user's guide, SPRU357C. The boot procedure is controlled by two pins: MP/MCn, and BOOT_ENn. This is discussed in that appendix, and also see p.21 of the datasheet SPRS145L. Normally, people will have MP/MCn=low, and BOOT_ENn=hi. This will cause the device to begin code execution from address 0x0000 of the internal flash. 99.999% of user's will use the device like this.
Regards,
David