你好mt_dialog,
I use the DA14580 development Kit-Basic and with the AN-B-023 I successfully loaded my project into the Flash memory (W25X20CL) and booted from it using SPI.
Now, I want to connect it to an STMicroelectronics STM32F103R8 using SPI, is it possible to load my project into it's internal flash memory and boot from it as I did with the DA14580 ? Or should I I implement a booting protocol in the ST Microcontroller to send data over SPI to my BLE module (slave) ?
Thank you very much and regards,
- 萨法夫
关键词:
设备:
嗨bensalemsaif,
我不完全究竟是什么想做的。当580靴子主引导程序期望特定端口上的特定字节序列(其他接口中的SPI Master / SPI从站)。请检查AN-B-001 - 从串行接口引导有关引导序列的更多信息。
Thanks MT_dialog
hi MT_dialolog,
感谢您的答案,事实上,我已经检查了AN-B-001,我的问题是:
I will integrate the PAN1740 module into an STMicroelectronics STM32F103R8 , and I want it to boot from the flash memory of the ST Microcontroller using SPI , so to do that, should I send my data to the 580 as described in the AN-B-001 ?
因为之前所做的,就是使用SmartSnippet,我将我的十六进制文件加载到SPI闪存中,580可以启动,它不能与ST微控制器中的集成闪存相同?如果不实现数据应该如何通过SPI发送...
Thank you,
Saif
嗨bensalemsaif,
AN-B-001描述了所有580个接口中的启动过程,开机,580的引导加载程序将运行,您应该在您选择的接口上提供适当的数据(案例主/从配置中的SPI)以便开始引导seqence。SDK中有一个例子在2 580的一个作为主站和另一个用#define spi_booter的SPI接口中的奴隶,您可以选择您的主设备下载.bin到您的从站。该示例位于host_apps / da1458x / proximity / Reporter下。
Thanks MT_dialog
嗨mt_dialog,
Thank you for your support , the reporter example is so helpful !
所以现在要从.hex文件中提取图像数据,我删除了地址,然后crc和我只保留了数据,我替换了0x00的空白,然后我把数据放入缓冲区,是正确的?它是正确的吗?
Thank you,
Saif
嗨bensalemsaif,
要下载的文件是.bin文件不是.hex文件,可以从SDK中的实用程序文件夹中从Hex2bin工具转换.hex到.bin从SDK中的Utilities文件夹,使用编辑器,复制和粘贴数据.bin在您的.c文件中,下载。
Thanks MT_dialog
嗨mt_dialog,
Thank you, I implemented as you said, now to be sure that my Pin configuration is OK, I did like described in the AN-B-001 : P-0-0 <-> SCK , P0_3 <-> CS , P0_5 <-> MOSI and P0_6 <-> MISO , and for other pins, should I put jumper ? (TCK,TMS,BATS)
第二点是关于时间的,我应该在580中的引导算法搜索SPI上的数据时完全发送数据,因此在循环和JTAG之前的5次之前需要多长时间?这是什么最好的方法?
Thank you,
嗨bensalemsaif,
TCK,TMS是调试器引脚如果您想通过Keil下载您的.bin,你必须使用那些引脚,如果不是,你也可以在蝙蝠引脚是开发套件上的SPI内存的引脚。请检查您拥有的开发套件的原理图。此外,您应该在启动加载程序运行时发送数据,以便下载要成功,它应该开始默认,在AN-B-001文档中描述了引导过程的步骤的确切超时。
Thanks MT_dialog
你好mt_dialog,
I'm still not able to boot from my SPI Master Microcontroller, so please could you verify this for me :
我开始使用MicroController的RESET引脚启动了580,如“AN-B-01”中所述等待103ms,然后在记者示例中策略发送报头(使能CS和发送数据)。但是我从来没有收到ACK或NACK,有时候我在STRINCE发送标题时拍摄了MISO的数据,请附上Saleae的标题发送分析的屏幕截图。
我错过了什么吗?
Thank you,
嗨bensalemsaif,
Working with the spi slave on the 580 is a bit tricky, please make sure that the SPI clock provided by the master is at least four times smaller that the internal SPI clock configuration on the slave, also please experiment with putting some delay on the master when sending data on the SPI bus. Also please check your connections, they should be as short as possible, shielded and properly terminated.
Thanks MT_dialog
你好mt_dialog,
Thank you for your reply, I will check my connections, and for the clock, the internal frequency on 580 is 16MHz that's right ? until now I'm sending data with master clock frequency = 250KHz, so it should be OK right ?
For putting some delay when sending data, I tried it but it seems not logic sence it will take so much time to send the image , it could be OK for the header but not for the image, so please confirm for the clock frequency and I will check my connections.
Thank you,
- saif.
嗨bensalemsaif,
内部SPI时钟频率可以达到16MHz(最大/最小分频器为1)。当SPI Master中的580靴子时,请检查AN-B-001是否有适当的SPI时钟设置。由于您的主人在频率上发送数据到达250khz,因此您应该可以正常,因为500只有在没有发出发送字节之间的任何延迟的限制。580中的SPI采样器是非常敏感的,电线电缆可能导致批次问题,因为它可能错误地接收小尖峰或脉冲的反射。
Thanks MT_dialog
你好mt_dialog,
Since SPI didn't work, I'm trying to boot from UART, so like before , I reset the 580 and then strat sending data when I receive the 0x02 strat byte, then when sending SOH , LEN_LSB and LEN_MSB I got the 0x06 ACK , so everything was OK , then I strat sending the image, but after that I didn't get any CRC.
The same image was successfully downloaded into SPI Flash memory (Smartsnippets)and 580 could boot from it.
Here attached the Saleae analysis , my hex and bin files (size is 19236 =4B24 )and how I'm sending data :
1 - 与记者示例:数据对齐(64),大小除以4,我正在使用相同的发送功能实现
2 - 数据未对齐,只是一个具有长度=数据大小的普通缓冲区,并按字节向其发送内容字节
But always the same result, is there anything missing ?
嗨bensalemsaif,
I am not able to open the Booting from UART.logicdata file (seems that the file is empty). Just take the binary as produced from the hex2bin program and download it through UART. If you dont wait for a CRC and send a 0x06 what is the 580 does ? Also you can try to run the secondary bootloader in order to debug this, you can run bootloader over keil and emulate the primary bootloader and debug it. Also are you able to download the file over UART using the smart snippets? Additionally you can try to boot from a different pair TX/RX if available. I ve uploded a capture from how a UART download image is.
Thanks MT_dialog
你好mt_dialog,
In fact I'm not able to download the file (or any file) using SmartSnippets over SPI/UART , it's done only over JTAG, otherwise, I can't erase the SPI flash memory, here attached the error:
So what could be the problem due to ?
谢谢,
嗨bensalemsaif,
Since you have a basic kit the only available option in smart snippets is the UART, the UART/SPI is only available for the pro and the expert kit. To program the SPI Flash have you made the proper connections on the basic kit (it requires an additional connection), please follow the the figure next to your pins for the connection of the SPI and additionally you have to connect the P0_4 jumper and also connect the P0_5 with the UART pin.
Thanks MT_dialog