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.
谢谢您,
--卡伊
嗨,克特里恩,
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.
谢谢你的对话
感谢您及时回应。这两个文档帮助我了解了580引导过程是如何工作的。
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.
也许我会尝试描述我的开发场景,你可以推荐如何做到。使用基本工具包,我可以通过使用Keil将代码加载到SRAM直接调试FW,并且目前还可以使用SmartSnippets编写flash。还有一个用我目前没有必要使用的SmartSnippet编写给OTP。
我们的定制板很简单。它由580个前端接口组成,通过BLE接口与手机应用程序。580将接收来自电话的消息,并通过580内部UART总线将其发送到显示设备。
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.
所以看看这个HW设计,580应用程序代码将有闪光区。连接到580 UART接口的显示芯片还具有FW代码,需要从中引导和执行。我们希望580应用程序代码和显示FW代码都在同一闪存中(我认为我们不需要OTP内存,除非有原因)
我对开发委员会启动顺序的问题如下:
1.通过以上硬件设计,我需要一个读/写闪存机制,将580应用程序代码从Flash加载到SRAM。这是辅助引导加载程序的工作吗?但是使用辅助引导加载程序需要车载OTP。辅助引导加载程序的源代码是否可用或类似的东西?
2.假设580现在正在启动并从Flash启动,则需要充当显示设备的外部主机控制器。它需要读取显示设备FW的闪存,并通过UART发送到显示设备,以便它现在可以启动。
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.
感谢您的反馈和推荐。。。
Thanks,
--卡伊
嗨,克特里恩,
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) 为了将fw从闪存加载到580 sysram,您不需要辅助引导加载程序,只要您遵循SPI引导的默认pin连接,主程序就可以这样做。辅助引导加载程序用于分配不同的引导引脚,在您为低功耗关闭闪存时打开闪存,加载不同的映像(SUOTA功能等)。如前所述,辅助引导加载程序源代码在SDK中的实用程序目录中可用。
2) If the display chip needs a fw i suppose that the 580 needs to send that fw, if the chip isn't able to download it directly from the flash, so yes you need a routine where the 580 will read the flash and send it to the display over UART. The 580 will exetute the normal booting sequence and after that it will act as a middleman between the display and the flash.
谢谢你的对话
是否有示例代码reading/writing from/to Flash?
Thanks,
--卡伊
嗨,克特里恩,
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\U SDK\5.0.4\utilities\secondary\u引导加载程序:辅助引导加载程序
DA1458x_SDK\5.0.4\projects\target_apps\peripheral_examples\spi : the spi flash example
谢谢你的对话
关于你的回答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.主引导加载程序是否驻留在ROM中?如果是这样,在我们生产时,我是否必须手动将主引导加载程序加载到每个芯片的ROM?或者,当我们收到DA14580生产时,我们已经完成了这个过程?
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?
Thanks,
--卡伊
后续问题:
1.外部PC应用程序(如SmartSnippets)如何直接访问580个外部闪存(读/写/擦除FW)。我可以使用SmartSnippets来闪存FW应用程序所需的数据文件吗?是否必须绑定到某个格式才能将此数据文件上载到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.数据文件用flash,FW应用程序代码还需要知道闪存中存储数据的地址和大小,以便读取和消耗数据。
Thanks,
--卡伊
嗨,克特里恩,
1) 主引导加载程序在ROM中完全就绪,加载程序的功能性在AN-B-001.pdf文档中描述,一般它为您提供一些标准引脚,以便通过UART/SPI/I2C引导。启动加载程序将在您的设备一通电就执行,您不必烧掉引导加载程序,因为正如我所提到的,它已经准备好了,它位于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) When smart snippets is instructed to connect to 580 in order to program the flash it downloads a small fw named flash_programmer or jtag_programmer, that fw handles all the commands from Smart Snippets (Erase/Burn etc ). Yes you can use smart snippets to flash your fw application. Regarding the format question, i dont quite get it, the SS will take the .hex convert it to .bin or you can place the .bin file directly and the tool will burn it on your flash.
2)请阅读手册我已经表明the procedure that the bootloader follows.
3) 正如我提到的,SPI模式下的580将从闪存中请求地址0的数据,并且闪存应该开始发送图像。映像必须是可引导的,这意味着如果选择了bootable选项,它应该具有可引导的头和由智能代码段测量和分配的代码长度。因此,智能代码段将额外做的是附加0x70 0x50头,以指示映像是可引导的,应用一些零填充并附加.bin文件的大小。
谢谢你的对话
让我澄清我的问题alittle better.
所以哒应用FW装载在flash的开始ing at address 0 so the primary loader upon power up can read from Flash and write it to SysRAM. Upon completely booted and running in SysRAM, the custom FW requires some data from flash to perform its task. This is the input data to some algorithm in the custom FW that we intended to write. This was the question I asked previously about the data file. Can I use SS to upload data file to Flash for my custom FW to consume after it was booted? This data file is not a bootable image. It's just some data that is required in the FW algorithm. For SS to be able to burn this data file to flash, does it need to follow some format so SS will recognize it and able to burn it to Flash?
Thanks,
--卡伊
嗨,克特里恩,
是的,智能代码段可以将自定义数据刻录到闪存中,您可以使用适当的头程序,甚至flash燃烧器,没有任何特定格式可遵循,以便使用智能片段将数据刻录到闪存中。您可以通过在某个地址将随机二进制文件刻录到devkits flash中来测试这一点。
谢谢你的对话
I would like to learn how SmartSnippets uses flash_programmer or jtag_programmer to /write/erase flash. Do you have source code for them?
Thanks,
--卡伊
never mind. Found it.
有没有一个应用程序说明,讨论flash\u程序员实用程序?
嗨,克特里恩,
No, there is no application note that documents the functionallity of the jtag_programmer. This fw is ment to be used by the Smart Snippets tool and not as a code reference.
Also please dont post a new question on an irrelevant topic, you can always create a new post.
谢谢你的对话