UM-B-012: Creation of secondary bootloader

3 posts / 0 new
Last post
vikramtheone
Offline
Last seen:5 years 4 weeks ago
加入:2015-06-12 08:42
UM-B-012: Creation of secondary bootloader

I was reading the UM-B-012 document, which addresses Creation of secondary bootloader.

My questions are regarding two things:
1. UART_SUPPORTED definition and
2. DMA length.

My system has an external SPI flash, which is there to hold my actual application. I've used the Smartsnippet's 'SPI flash programmer' tool to program the external slave SPI flash with my application, it was very easy. I'm able to read back the Flash and see (0x70, 0x50..... (Application code)). I want my SysRAM to be loaded with this program when it starts up.

I was reading the UM-B-012 to learn how to create a secondary bootloader for the OTP.

Most of it is clear and what I want to understand is:

我已经激活了SPI_FLASH_SUPPORTEDandSUPPORT_AN_B_001definitions, but in my system's case should I also enable theUART_SUPPORTEDdefine in the bootloader.h. I'm inclined toNOTenable it. But then if I do that, I have doubts about how to reprogram the SPI flash when my application changes, with the UART not supported.

1. So, by having a custom bootloader in the OTP with the UART_SUPPORTED flag disabled, will I still be capable of reprograming the external SPI flash using Smartsnippets tool whenever I need to in the future?

Next, the DMA length.
2. On Page 21 of the document, it says that you have to fix theDMA length. I don't know what this value should be.

Can anyone please explain more on these two questions?

Thank you.

Keywords:
Device:
MT_dialog
Offline
Last seen:3 months 13 hours ago
Staff
加入:2015-06-08 11:34
Hi vikramtheone,

Hi vikramtheone,

1.By burning the secondary bootloader to your OTP will enhance your system to boot faster by bypassing the port scanning of the da and go directly to your SPI flash memory. If define the SPI and the UART you will lose that privilledge because the UART is going to be scanned first (therefore you will be able to boot from UART and burn your SPI with Smart Snipptes) since the sb first checks the UART interface and then the SPI.

2.The value of the DMA field should be 1FC0 which means 32512 bytes which is the total size of the OTP area. After the da wakes up from deep sleep the custom code area in the OTP will all be copied to the system RAM.

Thanks MT_dialog

Joacimwe
Offline
Last seen:1 year 6 months ago
Guru
加入:2014-01-14 06:45
What is the purpose you want

What is the purpose you want to want to be able to re-program your code with SmartSnippets after you burn the secondary boot loader? The secondary boot loader is meant to only be used for production. You may still be able to attach to your device using JTAG if you have not disabled it in the OTP header. Another way to update your firmware is to use SUOTA. If you really want to be able to boot over UART you should enable UART_SUPPORTED.

The DMA field contains how many words of the OTP will be copied to sysram. 1FC0 means the whole application area. To optimize the time it takes to copy OTP to sysram you should set it to the size of the firmware stored in OTP, in this case the secondary bootloader (number of bytes divided by four rounded up). The time to copy is quite fast so if you don't bother to set the correct size you can always set 1FC0.