Fork of mbed-dev with the NUCLEO-L152RE target modified for use with the STM32L151RB (128 kB flash, 16 kB RAM).

Fork of mbed-dev by mbed official

To use this, remove the default "mbed" library and import this one instead. Target must be NUCLEO_L152RE.

Files at this revision

API Documentation at this revision

Comitter:
Jim Paris
Date:
Wed Oct 07 14:47:28 2015 -0400
Parent:
6:a09c7fe99a74
Child:
20:bd577c0b8d12
Commit message:
Use TIM9 instead of TIM5

STM32L151xB doesn't have TIM5. TIM9 is 16-bit instead of 32-bit, but
should still work OK.

Changed in this revision

targets/cmsis/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/hal_tick.h Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_STM/TARGET_STM32L1/sleep.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_STM/TARGET_STM32L1/us_ticker.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/cmsis/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/hal_tick.h	Tue Oct 06 17:44:28 2015 -0400
+++ b/targets/cmsis/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/hal_tick.h	Wed Oct 07 14:47:28 2015 -0400
@@ -42,12 +42,12 @@
 #include "stm32l1xx.h"
 #include "cmsis_nvic.h"
    
-#define TIM_MST      TIM5
-#define TIM_MST_IRQ  TIM5_IRQn
-#define TIM_MST_RCC  __TIM5_CLK_ENABLE()
+#define TIM_MST      TIM9
+#define TIM_MST_IRQ  TIM9_IRQn
+#define TIM_MST_RCC  __TIM9_CLK_ENABLE()
 
-#define TIM_MST_RESET_ON   __TIM5_FORCE_RESET()
-#define TIM_MST_RESET_OFF  __TIM5_RELEASE_RESET()
+#define TIM_MST_RESET_ON   __TIM9_FORCE_RESET()
+#define TIM_MST_RESET_OFF  __TIM9_RELEASE_RESET()
 
 #define HAL_TICK_DELAY (1000) // 1 ms
 
--- a/targets/hal/TARGET_STM/TARGET_STM32L1/sleep.c	Tue Oct 06 17:44:28 2015 -0400
+++ b/targets/hal/TARGET_STM/TARGET_STM32L1/sleep.c	Wed Oct 07 14:47:28 2015 -0400
@@ -38,7 +38,7 @@
 void sleep(void)
 {
     // Disable HAL tick interrupt
-    TimMasterHandle.Instance = TIM5;
+    TimMasterHandle.Instance = TIM9;
     __HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC2);
 
     // Request to enter SLEEP mode
@@ -55,7 +55,7 @@
 #endif
 
     // Disable HAL tick interrupt
-    TimMasterHandle.Instance = TIM5;
+    TimMasterHandle.Instance = TIM9;
     __HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC2);
 
 #if defined(TARGET_MOTE_L152RC)
--- a/targets/hal/TARGET_STM/TARGET_STM32L1/us_ticker.c	Tue Oct 06 17:44:28 2015 -0400
+++ b/targets/hal/TARGET_STM/TARGET_STM32L1/us_ticker.c	Wed Oct 07 14:47:28 2015 -0400
@@ -29,7 +29,7 @@
 #include "us_ticker_api.h"
 #include "PeripheralNames.h"
 
-#define TIM_MST TIM5
+#define TIM_MST TIM9
 
 static TIM_HandleTypeDef TimMasterHandle;
 static int us_ticker_inited = 0;