15 posts / 0 new
Last post
kqtrinh
Offline
Last seen:3 years 8 months ago
加入:2016-08-24 00:17
DA14580 Basic Kit SDK

Questions about the 580 DSPS peripheral mode FW code I would like to use as the starting point for our custom embedded software development.

As of right now, i would like to understand the mechanism of how Keil IDE or SmartSnippets which downloads the FW bit stream from the Host PC thru the USB connection to the MCU on the 580 to receive the bit stream and write to flash or load it into RAM. Upon power up, I believe the 580 will load the FW from Flash into RAM and starts execution. However, when the 580 has no FW currently resides in flash, I would think there should exist a piece of code that's running in RAM that will handle writing the incoming FW from SmartSnippets or Keil to flash or to RAM. This piece of code might be called ROM code kind of like the BIOS fw in the PC. Can you point me to the part of the code that handles flash or RAM upload interface? If i am totally off base, please educate me so i understand how this process works to help me in our custom development.

If there is a document that explains this process in details, that would be even better.

Thank you,
--Khai

Device:
MT_dialog
Offline
Last seen:1 month 1 day ago
工作人员
加入:2015-06-08 11:34
嗨kqtrinh,

嗨kqtrinh,

You can have a look at the AN-B-001.pdf or the UM-B-012.pdf, those documents mention how the booting sequence works, where the code is downloaded and runs. The code that exists in the 580 and loads a external fw is called the primary bootloader (or just bootloader) and its located in the ROM memory area. The source code isn't available, but its functionallity is described in the AN-B-001 document, its an ammount of options for the 580 to download code via UART/SPI/I2C.

Thanks MT_dialog

kqtrinh
Offline
Last seen:3 years 8 months ago
加入:2016-08-24 00:17
Thank you for the timely

Thank you for the timely response. These 2 docs helped me understand a little more about how the 580 booting process works.

It's OK the ROM code isn't available, will the secondary bootloader as described in the UM-B-012.pdf doc available or other sample code that is close to its functionality for booting from flash.
Maybe I will try to describe my development scenario and you can recommend how it can be done. With the basic kit, I can debug the FW directly by loading the code to SRAM with Keil and I can also write to flash with SmartSnippets at the moment. There is also writing to OTP with SmartSnippets which I haven't had a need to use at the moment.

Our custom board is quite simple. It consists of the 580 in the frontend interface over BLE interface with a phone app. The 580 will receive messages from the phone and send it over to a Display device through the 580 internal UART bus.

To debug the 580 application code, we will build an external debugger board (is there such a board exist on the market?) with the Atmel chip (not on the same board with the 580 due to size constraint). Basically separating the 580 basic kit into 2 boards.

So looking at this HW design, there will be flash area for the 580 application code. The Display chip that connects to the 580 UART interface also has FW code that it needs to boot from and execute. We want both the 580 application code and the Display FW code to be in the same flash memory (I don't think we need OTP memory unless there is a reason for it.)

My questions with the booting sequence for our development board below:

1. With the HW design above, I need a mechanism to read/write Flash to load the 580 application code from Flash to SRAM. Is this the job of the secondary bootloader? But using the secondary bootloader requires OTP onboard. Is source code for the secondary bootloader available or something similar?

2. Assuming the 580 is now up and running booting from Flash, it needs to act as an external Host controller to the Display device. It needs to read Flash for the Display device FW and send it over UART to the Display device so it can now boot.

That is my approach to the booting sequence for our dev board at the moment. From what you can see, we need code to read/write Flash and dump it to SRAM as well as dump it on to the UART bus by the 580 CPU.

You feedback and recommendation is appreciated...

谢谢,
--Khai

MT_dialog
Offline
Last seen:1 month 1 day ago
工作人员
加入:2015-06-08 11:34
嗨kqtrinh,

嗨kqtrinh,

Yes the secondary bootloader can be found in the utilities folder in the SDK and its quite similar with the primary bootloader. Regarding the debugger module you can use a Segger Jlink Lite ARM debugger, the same debugger that the expert kit uses. Regarding your questions:

1) In order to load the fw from the flash to the 580 sysram you dont need a secondary bootloader, the primary will be able to do that for you as long as you follow the default pin connections for the SPI booting. The secondary bootloader is for assigning different booting pins, turning on the flash in case you turn it off for low power consumption, load different images (SUOTA functionality etc). As a mentioned the secondary bootloader source code is available in the utilities directory in the SDK.

2)如果显示芯片需要FW,我想580需要发送该FW,如果芯片无法直接从闪光灯下载,所以是您需要一个例程,580将读取闪存并发送它到uart上的显示。580将验证正常启动序列,之后它将充当显示器和闪光之间的中间人。

Thanks MT_dialog

kqtrinh
Offline
Last seen:3 years 8 months ago
加入:2016-08-24 00:17
Is there sample code to

Is there sample code to reading/writing from/to Flash?
谢谢,
--Khai

MT_dialog
Offline
Last seen:1 month 1 day ago
工作人员
加入:2015-06-08 11:34
嗨kqtrinh,

嗨kqtrinh,

There is a driver for writing in the flash and there is also an example that interacts with the flash, the example is located in the SDK at the peripheral_examples projects in the spi directory. And also as mentioned previously there is the secondary_bootloader source code in the utilities directory. Please check the below SDK directories.

DA1458x_SDK\5.0.4\utilities\secondary_bootloader : the secondary bootloader

DA1458x_SDK\5.0.4\projects\target_apps\peripheral_examples\spi : the spi flash example

Thanks MT_dialog

kqtrinh
Offline
Last seen:3 years 8 months ago
加入:2016-08-24 00:17
关于你的回答

关于你的回答question 1 above, If I understand correctly, I don't need the secondary bootloader to do what I need. The primary bootloader can do the job. Then my questions are:

1. Does the primary bootloader reside in ROM? If so, do I have to manually load the primary bootloader to ROM for every chip when we go production? Or this process was already done for us when we receive the DA14580s for production?

2. Assuming the DA application FW resides in SPI Flash, where in external SPI Flash address does the primary loader read the FW from to download to SysRAM? Is it by default address 0? Is this starting address programmable?

谢谢,
--Khai

kqtrinh
Offline
Last seen:3 years 8 months ago
加入:2016-08-24 00:17
Follow up questions:

Follow up questions:

1. How does external PC application such as SmartSnippets have direct access (read/write/erase FW) to 580 external flash. Can I use SmartSnippets to flash data file for the FW application to consume? Does it have to bind to some format to upload this data file to flash?

2. Once FW is on external Flash, ROM primary bootloader must need to know 2 piece of info: address and size of FW to load to SRAM. Does SmartSnippets have these information set somewhere in flash so ROM has a knowledge so it can load the FW to SRAM?

3.With the data file in flash, the FW application code also needs to know the address and size of where the data is stored in flash so it can read and consume the data.

谢谢,
--Khai

MT_dialog
Offline
Last seen:1 month 1 day ago
工作人员
加入:2015-06-08 11:34
嗨kqtrinh,

嗨kqtrinh,

1) The primary bootloader is allready burned in ROM and the functionallity of the loader is described in the AN-B-001.pdf document, in general it provides you some standard pins in order to boot via UART/SPI/I2C. The bootloader will execute as soon as you power up your device, you dont have to burn the bootloader since as i ve allready mentioned it is allready located in ROM.

2) The bootloader when the procedure is flash related and the 580 executes as master it will access the address 0 of the flash memory, in the primary bootloader this is not programmable. All those info are documented in the .pdf i mentioned.

Regarding the follow up questions:

1)当指示智能片段连接到580时,为了对闪存进行编程,它会下载一个名为Flash_Programmer或JTAG_Programmer的小FW,该FW处理来自Smart代码段(擦除/刻录等)的所有命令。是的,您可以使用智能片段闪烁您的FW应用程序。关于格式问题,我不太明白,SS将采取.hex将它转换为.bin或者您可以直接放置.bin文件,该工具将刻录闪光灯。

2)请阅读the manual i ve indicated to see the procedure that the bootloader follows.

3) As i mentioned, the 580 in SPI mode will request data from address 0 from the flash and the flash should start sending the image. The image has to be bootable and that means that it should have the bootable header and the length of the code - measured and assigned by smart snippets if the bootable option is selected. So what Smart Snippets will additionally do is to attach the 0x70 0x50 header in order to indicate that the image is bootable apply some zero padding and attach the size of the .bin file.

Thanks MT_dialog

kqtrinh
Offline
Last seen:3 years 8 months ago
加入:2016-08-24 00:17
Let me clarify my questions a

让我澄清我的问题一点。

因此,DA在Address 0启动闪存中的闪存中加载FW,因此可以从Flash读取电源时的主装载机并将其写入Sysram。在Sysram中完全启动和运行时,自定义FW需要来自Flash的一些数据来执行其任务。这是我们打算写入的自定义FW中某些算法的输入数据。这是我之前关于数据文件的问题。我可以使用ss将数据文件上传到闪存,因为我的自定义fw被启动后消耗?此数据文件不是可引导图像。它只是FW算法中需要的一些数据。对于能够将此数据文件刻录到闪存,是否需要遵循一些格式,因此SS将识别它并能够将其刻录到闪存?

谢谢,
--Khai

MT_dialog
Offline
Last seen:1 month 1 day ago
工作人员
加入:2015-06-08 11:34
嗨kqtrinh,

嗨kqtrinh,

Yes Smart Snippets is able to burn your custom data into the flash, you can use either the propriety header Programmer or even the Flash burner, there isn't any specific format to follow in order to burn data into the flash using smart snippets. You can test this by burning a random binary file to your dev kits flash at some address.

Thanks MT_dialog

kqtrinh
Offline
Last seen:3 years 8 months ago
加入:2016-08-24 00:17
I would like to learn how

I would like to learn how SmartSnippets uses flash_programmer or jtag_programmer to /write/erase flash. Do you have source code for them?

谢谢,
--Khai

kqtrinh
Offline
Last seen:3 years 8 months ago
加入:2016-08-24 00:17
never mind. Found it.

never mind. Found it.

kqtrinh
Offline
Last seen:3 years 8 months ago
加入:2016-08-24 00:17
Is there an application note

Is there an application note that talks about flash_programmer utility?

MT_dialog
Offline
Last seen:1 month 1 day ago
工作人员
加入:2015-06-08 11:34
嗨kqtrinh,

嗨kqtrinh,

不,没有应用程序注意,记录JTAG_Programmer的函数。此FW是由智能代码段工具使用而不是代码参考。

Also please dont post a new question on an irrelevant topic, you can always create a new post.

Thanks MT_dialog