Reset / Reboot XDK system
Antwort
28.09.18 16:06

Hello - I have found this information above how it is possible to reset / reboot XDK system.
Actually I need this functionality in a code build with WB1.7.
Can you give me a hint how the function is called there ?

This is possible, of course.
For that, call the function BSP_Board_SoftReset() from the interface BCDS_BSP_Board.h .
You can let any event of your choosing trigger that function. You can also send the message "#reSet$\n" to the XDK (where \n is a newline) via USB at any time, to restart the application.
 

0 (0 Stimmen)
RE: Reset / Reboot XDK system
Antwort
01.10.18 14:48 als Antwort auf Achim Kern.
Hello Achim,

the function call you are looking for is NVIC_SystemReset() from the core_cm3.h interface. Since the interface comes from the XDK MCUs library EMLib , the call should work with every XDK-Workbench version, including yours (1.7).

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Stimmen)
RE: Reset / Reboot XDK system
Antwort
01.10.18 17:04 als Antwort auf Franjo Stjepandic.

Hello Franjo, got now these debug messages

./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1323:37: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1335:38: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1351:45: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1363:41: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1375:43: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1390:41: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1405:39: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1425:43: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h: In function 'NVIC_EncodePriority':
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1453:51: error: '__NVIC_PRIO_BITS' undeclared (first use in this function)
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1453:51: note: each undeclared identifier is reported only once for each function it appears in
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h: In function 'NVIC_DecodePriority':
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1481:51: error: '__NVIC_PRIO_BITS' undeclared (first use in this function)
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h: In function 'SysTick_Config':
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1537:21: error: 'SysTick_IRQn' undeclared (first use in this function)
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1537:39: error: '__NVIC_PRIO_BITS' undeclared (first use in this function)

I need a simple easy reboot / reset system ?
ResetXDK();

means the same like in the Workbench our BOOT Button for example

0 (0 Stimmen)
RE: Reset / Reboot XDK system
Antwort
04.10.18 08:25 als Antwort auf Achim Kern.
Hello Achim,

thank you for the quick response. Unfortunately, an additional necessary include was missing in my last post. To make the function work, you need to include em_device.h in your source file, too.

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Stimmen)
RE: Reset / Reboot XDK system
Antwort
08.10.18 07:26 als Antwort auf Franjo Stjepandic.
Got now these errors

./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1323:37: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1335:38: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1351:45: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1363:41: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1375:43: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1390:41: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1405:39: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1425:43: error: unknown type name 'IRQn_Type'
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h: In function 'NVIC_EncodePriority':
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1453:51: error: '__NVIC_PRIO_BITS' undeclared (first use in this function)
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1453:51: note: each undeclared identifier is reported only once for each function it appears in
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h: In function 'NVIC_DecodePriority':
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1481:51: error: '__NVIC_PRIO_BITS' undeclared (first use in this function)
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h: In function 'SysTick_Config':
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1537:21: error: 'SysTick_IRQn' undeclared (first use in this function)
./../Libraries/EMlib/EMLib/CMSIS/Include/core_cm3.h:1537:39: error: '__NVIC_PRIO_BITS' undeclared (first use in this function)
0 (0 Stimmen)
RE: Reset / Reboot XDK system
Antwort
08.10.18 11:38 als Antwort auf Achim Kern.
Hello Achim,

Please include em_device.h , before you include core_cm3.h . This should solve your issue.

Alternatively, you can also try the following example code for resetting the XDK on XDK-Workbench 1.7.0:

 

/* system header files */
#include "BCDS_Basics.h"

/* additional interface header files */
#include "FreeRTOS.h"
#include "timers.h"

#include "em_device.h"
#include "core_cm3.h"

/* own header files */
#include "XdkApplicationTemplate.h"

void appInitSystem(xTimerHandle xTimer)
{
(void) (xTimer);
vTaskDelay(UINT32_C(5000));
NVIC_SystemReset();
}


Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Stimmen)
RE: Reset / Reboot XDK system
Antwort
14.10.18 08:48 als Antwort auf Franjo Stjepandic.

Hello Franjo,
today i was able to test the reset solution again.
Sorry about the delay.
Now it works as it should. This code is absolutely necessary - cause i am now able
to reboot and get the system stable again if there was a fatal or strange error at start or runtime.

 INFO | XDK DEVICE 3: [x] Bosch XDK - all avaibale inbuild sensors initialized 
 INFO | XDK DEVICE 3: [x] Bosch XDK - buttons,leds and the expansionboard initialized 
 INFO | XDK DEVICE 3: [x] Bosch XDK - initializing WLAN 
 INFO | XDK DEVICE 3: [x] Bosch XDK - setting IP to DHCP 
 INFO | XDK DEVICE 3: [x] Bosch XDK - connecting to KeHoSoftware 
 INFO | XDK DEVICE 3: [ ] Bosch XDK - error occurred connecting KeHoSoftware 
 INFO | XDK DEVICE 3: [x] Bosch XDK - Reboot in 10 secs - please check your settings of your SD card !


Perfect.

Greetings Achim

 

0 (0 Stimmen)
RE: Reset / Reboot XDK system
Antwort
15.10.18 15:05 als Antwort auf Achim Kern.
Dear Achim,

I am glad to hear that it is working now and that you were able to integrate the feature into your company firmware.

Please feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Stimmen)