我正在尝试使用DA14580使用DA14580主板和BLE Barebones项目进行关于BLE
I think it is not possible to use printf() function for debugging using Keil (https://support.dialog-semicondiondiondum/forums/post/dialog-smartbond-bl ...),所以我试图将眨眼样本程序中的UART功能添加到BLE Barebones项目中
我添加了一组common_uart ble_app_barebone_580 in the Project tree view in Keil, and included common_uart.c in this group
The common_uart.c and common_uart.h files were added in the folder "...ble_app_barebone\src"
I have added the following lines in user_barebones.c
#include "common_uart.h"
printf_string(“输入user_app_adv_start \ n”);
It builds without any errors, but when I run the program after entering debug mode, it stops at the point
__asm("BKPT #0\n");
in nmi_handler.c
I didn't perform any initialization for the UART which I think might be causing this. So my questions are:
1. Is this the correct approach to adding UART in the barebones project?
2. Where is the main() function in the barebones project? I found int main_func(void){..} inside arch_main.c. Is this the main function? Is it safe to edit this file to add UART initialization code?
3. Am I correct in understanding that I cannot use printf() function to add diagnostic messages?
嗨马哈茹,
Thanks MT_dialog
Hello
Thank you for the quick reply
I added
1)#define cfg_printf在da1458x_config_basic.h中,之后的#undef cfg_printf已经存在
2) #include "arch_console.h" in user_barebone.c and
3) arch_printf("Entered user_app_adv_start\n"); inside the function void user_app_adv_start(void)
我希望当BLE广告开始时,我会在Teraterm上看到一些东西,但我没有看到任何东西
I see a few lines of gibberish when the program starts, but nothing after that
我已经将波特率和COM端口设置为与Blinky示例程序一起使用的相同值
I am however, not sure about what you meant by point 4 in your earlier reply. I have left all the jumpers on the board in their default locations, the same settings that the board had when I received it ( I have attached a screen shot of my current jumper locations). The Blinky sample works without any jumper modifications
After having a look at the schematics document ("E-da14580devkt-p_vb_schematic.pdf" in page 1) I tried connecting pins 7 and 8 of J8 on my motherboard (DA14580DEVKT-P_VC, current daughterboard is DA14580ATDB-P, but I need this work for the WLCSP34 daughterboard as well) thinking that would connect PORT2 pins 6 and 7, but the UART is still not working
What could be the problem? Alternatively, is it possible to use the UART without any hardware changes to the motherboard, using the same hardware and software settings being used in the Blinky program?
--- EDIT ---
This problem has been solved by connecting pin 7 of J7 to 12 of J5, and pin 8 of J7 to 14 of J5
The UART output shows up on the smaller of the two virtual serial ports
All the software modifcations mentioned above have been made
(motherboard is DA14580DEVKT-P_VC, daughter board is DA14580ATDB-P)
** NEW QUESTION **
I would still like to know whether it is possible to enable UART in the BLE projects without having to make any hardware modifications, same as in the Blinky program. I would also like to know if my current hardware configuration will work the same way, if the daughter board is replaced with the WL-CSP34 daughter board.
嗨马哈茹,
The jiberish that you see when start the debug session is just the bootloader executing after the JTAG resets the board.
在第4点中提到的我在4中提到的是改变默认的UART2引脚(因为默认打印实用程序使用UART 2,默认引脚为P26和P27),因此这是打印的位置,因此您可以连接两个选项具有上面提到的引脚的on LoSt FTDI引脚或将引脚配置和使用代替P26和P27作为TX和Rx的PIN P04和P05(检查UART2_TX / RX_GPIO_PORT和UART2_TX / RX_GPIO_PIN))。使用后一种方法,您不必在Pro套件上更改任何配置,并将跳线配置保持在附件上。
I suppose that the above statement answers to your question, in the case of WL-CSP34, this wont work since that package doesn't have a PORT2 pins but only PORT0 and PORT1 so the above method will also work for the CSP package.
Thanks MT_dialog