Dear Support,
Thanks for you help so far. I am trying to debug the SPS code: DA1458x_DSPS\v_5.150.2\projects\target_apps\dsps\sps_device with a DA14583DEVK. I am able to connect the the board, download the code and if I then disconnect, the firmware runs and I am able to use it. Unfortunately, when I run the code, it always stops in the debugger at address after a few seconds 0x00000000.
I would like to add my code and debug this project, but I am stuck. Do you have any suggestions?
FYI: I can debug the simpler projects from: SDK 5.0.3 no problem.
Cheers,
Rich
Device:
Dear Support,
I disabled sleep mode and now I can debug. That made sense. I did this by setting app_default_sleep_mode = ARCH_SLEEP_OFF. Now to the crux of the matter. I want to have a GPIO represent whether the BLE is connected or not. I thought turning on and off the LED would be a good idea. This works if sleep mode is OFF and it doesn't if sleep mode is on.
I added this to system_init();
/****************************************************************************************/
/* LED GPIO configuration */
/****************************************************************************************/
#define LED_PORT GPIO_PORT_1
#define LED_PIN GPIO_PIN_0
这GPIO_reservations ()
RESERVE_GPIO( LED_DISPLAY, LED_PORT, LED_PIN, PID_GPIO);
This to set_pad_functions()
// Init LED
GPIO_ConfigurePin(LED_PORT, LED_PIN, OUTPUT, PID_GPIO, false);
This to user_on_connection()
GPIO_SetActive( LED_PORT, LED_PIN );
这user_on_disconnect()
GPIO_SetInactive(LED_PORT, LED_PIN);
Again, like I said, if I don't go to sleep mode, the LED works great. If I let the application go to sleep, the LED doesn't turn on. Any suggestions?
Thanks so much!
Rich
Hi Richard,
The 580 will sleep and wake up in the predefined connection or advertising interval, that means that it will be sleeping between those events, when the 580 sleeps the GPIO pins are latched, so they maintain their previous state, but when waking up the periph_init() function will re-run and reinitialize the GPIO, therefore they will take the state that the application has defined in the periph_init() function. In the no_sleep_mode the periph_init() is being invoked only once therefore you can see the device behaving as expected. As a solution to this you should have a variable that will remember that state of your application (CONNECTED or not) or you can directly check the state of your TASK_APP and in the periph_init() configure your pins accordingly to the state of your application.
Thanks MT_dialog
Thanks for the reply. That was a great answer. I solved my problem given this insightful information.
Cheers,
Rich