You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2022/03/06 15:49:45 UTC

[mynewt-core] 02/02: bsp/p-nucleo-wb55: Fill hal_bsp_deinit function

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit bb6aac235fd473beee9364697700fee7e339c977
Author: Jerzy Kasenberg <je...@apache.org>
AuthorDate: Sat Mar 5 20:21:14 2022 +0100

    bsp/p-nucleo-wb55: Fill hal_bsp_deinit function
    
    De-initialization (disabling of all peripherals that may be used by bootloader
    to avoid confusion in application.
---
 hw/bsp/p-nucleo-wb55/src/hal_bsp.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/hw/bsp/p-nucleo-wb55/src/hal_bsp.c b/hw/bsp/p-nucleo-wb55/src/hal_bsp.c
index d44a415..da0fbae 100644
--- a/hw/bsp/p-nucleo-wb55/src/hal_bsp.c
+++ b/hw/bsp/p-nucleo-wb55/src/hal_bsp.c
@@ -100,6 +100,25 @@ hal_bsp_init(void)
 void
 hal_bsp_deinit(void)
 {
+    RCC->AHB1ENR = 0;
+    RCC->AHB2ENR = 0;
+    RCC->AHB3ENR = RCC_AHB3ENR_FLASHEN | RCC_AHB3ENR_HSEMEN;
+    RCC->APB1ENR1 = RCC_APB1ENR1_RTCAPBEN;
+    RCC->APB1ENR2 = 0;
+    RCC->APB2ENR = 0;
+    RCC->AHB1RSTR = 0x00011007;
+    RCC->AHB2RSTR = 0x0001209F;
+    RCC->AHB3RSTR = 0x021F1000;
+    RCC->APB1RSTR1 = 0x85A04201;
+    RCC->APB1RSTR2 = 0x00000021;
+    RCC->APB2RSTR = 0x00265800;
+
+    RCC->AHB1RSTR = 0;
+    RCC->AHB2RSTR = 0;
+    RCC->AHB3RSTR = 0;
+    RCC->APB1RSTR1 = 0;
+    RCC->APB1RSTR2 = 0;
+    RCC->APB2RSTR = 0;
 }
 
 /**