如何为辅助引导程序配置UART引脚?

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
16 posts / 0 new
最后一篇
vivek.
离线
Last seen:2 years 5 months ago
加入:2017-07-08 07:11
如何为辅助引导程序配置UART引脚?

你好,

I would like to burn a secondary bootloader into OTP via J-Link. I want to copy the application code to RAM from my host controller over UART. I want to configure GPIO pins P1_0 as Tx and P1_1 as Rx for bootloader. From where i can download the secondary bootloader program and how can i configure the Tx and Rx pins ?

Device:
MT_dialog
离线
Last seen:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
Hi Vivek,

Hi Vivek,

The secondary bootloader is located in the SDK in the utilities folder, you will have to define the SUPPORT_AN_B_001 in order to enable the secondary bootloader feature and then disable the spi and i2c interfaces via undefining the SPI_FLASH_SUPPORTED and the EEPROM_FLASH_SUPPORTED and define the UART_SUPPORTED. After doing that you will have to change the UART pins to the ones that you would like by changing the definitions of UART_GPIO_PORT, UART_TX_PIN and UART_RX_PIN. Doing the above should be ok, you can test the fw before burning it to the OTP by running it directly to sysram and download a fw to UART.

Thanks MT_dialog

vivek.
离线
Last seen:2 years 5 months ago
加入:2017-07-08 07:11
Hi MT_dialog,

Hi MT_dialog,

Thank you for quick reply. I have followed the steps you have explained in last reply. For testing I have downloaded the secondary bootloader firmware to sysram using Jlink and i have connected the Uart lines to PC through USB to uart converter. But I am not able see anything in uart lines. Once the bootloader firmware is successfully loaded, I am expecting that the BLE module will transmit "0x02" continuously.

I have downloaded SDK from "https://support.dialog-semiconductor.com/connectivity/product/da14580?qt..." and made the following changes in
bootloader.h and changed UART_GPIO_PORT , UART_TX_PIN and UART_RX_PIN macros.Please verify it.

changed line number 24 from #undef UART_SUPPORTED to #define UART_SUPPORTED
从#define spi_flash_supported到#undef spi_flash_supported的行数27
line number 37 from #undef SUPPORT_AN_B_001 to #define SUPPORT_AN_B_001

MT_dialog
离线
Last seen:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
Hi Vivek,

Hi Vivek,

The configurations that i ve mentioned are valid, if you dont see the 0x02 that means that the device doesn't track the RX pin that you have set in hign state, in the bootloader in the main function in the UART supported section there is a condition if (GPIO_GetPinStatus(UART_GPIO_PORT, UART_RX_PIN)) that checks the RX pin before executing the scanning procedure.

Thanks MT_dialog

vivek.
离线
Last seen:2 years 5 months ago
加入:2017-07-08 07:11
Hi MT_dialog,

Hi MT_dialog,

我在RX引脚上检查了电压,我得到3.3伏。但我仍然无法看到0x02。

如果我在调试模式下运行代码,则它正常工作。我能够在终端中看到0x02,我能够使用SmartSnippets工具编程其他示例项目。我遵循了在Alps开发套件应用笔记中解释的步骤,以便在调试模式下运行。

如何在发布模式下工作?

MT_dialog
离线
Last seen:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
Hi Vivek,

Hi Vivek,

您究竟是什么意思在调试模式和释放模式下运行代码?副引导程序具有禁用的CFG_Development_debug定义,在我的侧面输出RAM中的项目输出0x02字节以从外部UART引导。我不熟悉阿尔卑斯山文件。

Thanks MT_dialog

vivek.
离线
Last seen:2 years 5 months ago
加入:2017-07-08 07:11
Your side are you trying

Your side are you trying bootloader through P1_0 as Tx and P1_1 as Rx ?

Release mode means I will download the .hex file to sysRam using smartsnippet tool. In this method i am not getting 0x02.

For running in debug mode we have an option in kiel by clicking on the icon shown in attachment. Then we can do step by step execution or continuously run code. In this method i am getting 0X02. But for final product I want to use the hex file. So I want to verify it by downloading to sysRam before burning into OTP.

If you need alps document please send your email id tovivek@technosphere.in或者jasim@technosphere.in

附件:
MT_dialog
离线
Last seen:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
Hi Vivek,

Hi Vivek,

我通过使用JTAG接口测试了下载过程,确实我看到了在P10和P11引脚上没有动作(我认为这是你所看到的)下载FW时,但我也尝试使用UART接口探讨了两个引脚和FW正常运行,我可以假设这与下载过程有关,而不是使用.hex文件,在两种情况下,在Sysram中都是相同的,它是镜像,但出于某种原因从使用智能片段从JTAG下载二进制文件时FW无法运行,但是,我不认为这与FW无关,如果例如,您将二进制文件加载到Flash才能模仿OTP复制它应该正常工作以及下载FW通过UART。

Thanks MT_dialog

vivek.
离线
Last seen:2 years 5 months ago
加入:2017-07-08 07:11
Hi MT_dialog,

Hi MT_dialog,

我的HARWAW中没有选项以点击Port0引脚(用于Inbuilt UART引导程序)。所以我必须使用jlink加载辅助引导程序固件。如果我刷掉次级引导加载程序的十六进制文件来选择使用jlink,它会正常工作吗?或者它会面临同样的问题?

vivek.
离线
Last seen:2 years 5 months ago
加入:2017-07-08 07:11
Hi MT_dialog,

Hi MT_dialog,

I have tried to burn hex file into OTP using Jlink. I followed WI_Dialog's instruction in the posthttps://support.dialog-semicondiondiondum/program-da14580-otp-memory.和用户手册“UM-B-083”。但我收到错误消息“JTAG地址0x81FEC(MSB第一):FF FF FE”并通过在失败之前通过写2个字节来损坏OTP。

Please find the attached images.

MT_dialog
离线
Last seen:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
Hi Vivek,

Hi Vivek,

正如我上一篇文章中所提到的那样,我怀疑没有能够使用智能片段直接从Sysram下载和运行seconder_bootlooder的原因是智能片段它是自我的,因为我能够使用Segger指挥官下载.bin运行二进制文件。所以,如果在OTP中刻录辅助启动器,我不认为会有这个问题,我也使用闪存(闪存中的闪存中的次级引导加载程序)和二进制运行时测试此问题。

关于OTP的问题。这可能是由于OTP编程供应引起的问题。所以请检查一下。

Thanks MT_dialog

vivek.
离线
Last seen:2 years 5 months ago
加入:2017-07-08 07:11
Hi MT_dialog,

Hi MT_dialog,

感谢您的建议。我已成功将程序刻录为OTP(问题与OTP Supply 6.8)。二级引导加载程序现在正常工作。我能够看到0x02,我能够使用Smart Scippet工具加载到Sysram的应用程序。

但只要我加载应用程序固件虽然我的主机控制器虽然,但它无法正常工作。发送标题(SOH和Length)时,我正在获得合适的ACK,我在固件数据包结束时获得CRC。由于CRC匹配我将ACK发送到BLE模块。但在那之后,我持续获得“0x02”。

It seems like BLE module is getting restarted and the data from OTP overwrites my application code.

Do i have to set something in OTP header to avoid this ? or is there anything missed in secondary bootloader firmware?

Note:-
I have made the following changes in OTP header as per Alps reference manual.
Application flag1: Yes・ Application flag2: Yes・ Calibration Flag: bit[4]=1. Xtal 16MHz Trim Values : 320・ DMA Length : 1FC0

MT_dialog
离线
Last seen:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
Hi Vivek,

Hi Vivek,

该序列如此,设备将从OTP引导,它将从OTP加载自定义引导加载程序,设备将运行引导加载程序并在设备查找内容时立即开始检查您的自定义端口,从而开始复制FWUART到Sysram,然后当设备成功完成下载序列时,它将分支到新下载的FW。辅助引导加载程序的FW运行到RET RAM而不是在Sysram中,因此我不认为OTP将下载到Sysram中的FW重写。也许下载的FW运行以及Somepoint它会导致重置设备?在OTP中没有燃烧额外的配置。

Thanks MT_dialog

vivek.
离线
Last seen:2 years 5 months ago
加入:2017-07-08 07:11
Hi MT_Dialog,

Hi MT_Dialog,

"when the device succesfully finishes the download sequence it will branch to the newly downloaded fw."
>>我认为这个分支没有正常发生。从BLE模块获取CRC后,我正在发送ACK(0x06)。我希望引导加载程序代码一旦从主机控制器获得ACK就必须处理分支到新下载的固件。

“也许正在下载的FW运行以及Somepoint它导致设备重置?”
> >没有。我一直和我的应用程序代码和一个n example code in SDK (SDK 5.0.4\DA1458x_SDK\5.0.4\projects\host_apps\da1458x\proximity\reporter). I have sent the firmware contains in "prox_reporter_ext.h" file in the above mentioned project. In both case It failed. It is either getting reset or program is jumping to some wrong address and once the program counter reaches its maximum, execution is starting from reset address.

"There is no additional configuration to burn in the OTP."
>>Can you please verify my changes in OTP header? ( Application flag1: Yes・ Application flag2: Yes・ Calibration Flag: bit[4]=1. Xtal 16MHz Trim Values : 320・ DMA Length : 1FC0)

MT_dialog
离线
Last seen:2 months 2 weeks ago
职员
加入:2015-06-08 11:34
Hi Vivek,

Hi Vivek,

您是否测试过这一点以检查这是否是在所有通行条件下发生的东西,而且不仅当引导加载程序刻录到OTP时?例如,您尝试通过Keil下载FW(为了运行次级引导加载程序),而辅助引导者运行使用Smart Scippets Booter Tool下载FW?我试过上面的问题,我能够通过UART从引脚P10和P11引导,并在成功上传图像时准确地检查辅助靴子分支的位置。

我没有看到烧焦到OTP的值的任何错误,两个标志都应该设置为yes,以便从OTP引导,这对于依赖于您的水晶的XTAL 16MHz修剪值,并且DMA长度不是必需品,但我不认为它会给你带来任何问题。

关于分支,当设备成功下载FW时,辅助引导加载程序将转到sw_reset()中的start_run_user_application()将从新下载的fw的向量表中分配堆栈值到sp寄存器和然后将分支到下载的fw的reset_handler。

Thanks MT_dialog

vivek.
离线
Last seen:2 years 5 months ago
加入:2017-07-08 07:11
Hi MT_dialog,

Hi MT_dialog,

谢谢您的支持。它现在正常工作。问题是阅读固件阵列的方式。我已经参与了“SDK 5.0.4 \ da1458x_sdk \ 5.0.4 \ projects \ host_apps \ da1458x \ proximity \ eporter \ src”的示例代码spi_booter.c.并将其转换为UART接口。在转换时,我犯了一个错误,导致读错的地址。