Hi,
I use Murata module Type ZY (DA14580) daughter board with P2ML3078 evaluation board.
I connected the evaluation board to STM32L152 discovery evaluation board.
I use SPI (from STM as master) to load the code to the device, and use USART for communication with the device.
When I load the DSPS code to the device I manage to connect to a smart phone and start USART communication.
I try to add IO port indication to know if the device is connected (in my final design I will use P1_0 to signal the host MCU (STM) that the device is connected so USART communication will happen only if connection is active).
I did the following changes to the DSPS code:
In function "main_func“我添加以下行后调用toperiph_init()function.
GPIO_SetPinFunction(GPIO_PORT_1, GPIO_PIN_0, OUTPUT, PID_GPIO);
GPIO_SetInactive(GPIO_PORT_1, GPIO_PIN_0);
At the end of the functions "app_disconnect_func" and "app_adv_start" I added the following line so the port will be low when the device is not connected.
GPIO_SetInactive(GPIO_PORT_1, GPIO_PIN_0);
At the end of the function "app_connection_func" I added the following line so the port will be high when the device is connected.
GPIO_SetActive(GPIO_PORT_1, GPIO_PIN_0);
After adding these lines I no longer able to find the device on my phone.
Ideas?
Thank you
Hi Clonimus,
Are you using Smartsnippets to to download code, or the jLink, please use the debuger to see where the program stucks, maybe you have forgot to reserve your gpio pins in the periph setup.c, please check also if the app_adv_start() executes.
Thanks MT_dialog
Hi,
I'm using the SPI in my STM MCU to download the code to the device, unfortunately I have no Jlink.
I do not reserve the pin (P1_0) in periph setup.c
I'm new to Dialog processors, is that a must in order for the port to work?
Does the "DESCRIPTIVE_NAME" in "RESERVE_GPIO" must be defined somewhere or is it just a label need to write there?
Thank you
Hi Clonimus,
Yes it is a must, please refer to the document UM-B-004 Peripheral Drivers the GPIO driver section.
Thanks MT_dialog