Boot time is 10 seconds for a NUCLEO_L452RE build

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
User avatar
RWLTOK
Posts: 53
Joined: Thu Dec 14, 2017 7:24 pm

Boot time is 10 seconds for a NUCLEO_L452RE build

Post by RWLTOK » Mon Jan 20, 2020 12:09 am

I built V1.12 for the NUCLEO_L452RE board. When I reset the board, it is nearly 10 seconds before a promt appears. I checked this with a logic analyzer to prove that it was not a delay from WinDoz. Thoughts anyone? For what it's worth, I used whatever compiler you get with a apt-get install gcc-arm-none-eabi on Ubuntu 18.04 and not the latest version 9 that came out last Novemer from ARM Ltd.

Code: Select all

MicroPython v1.12-68-g3032ae115 on 2020-01-19; NUCLEO-L452RE with STM32L452RE
Type "help()" for more information.
>>>
Thanks

Rich

PS: With the same build environment, I created an image for the PYBV11. Here is the output. It responded to a reset in the normal quick time.

Code: Select all

MicroPython v1.12-68-g3032ae115 on 2020-01-19; PYBv1.1 with STM32F405RG
Type "help()" for more information.
>>>

User avatar
RWLTOK
Posts: 53
Joined: Thu Dec 14, 2017 7:24 pm

Re: Boot time is 10 seconds for a NUCLEO_L452RE build

Post by RWLTOK » Mon Jan 20, 2020 12:19 am

Here is some additional information:

Code: Select all

~/micropython/ports/stm32/boards$ diff NUCLEO_L452RE/stm32l4xx_hal_conf.h PYBV11/stm32f4xx_hal_conf.h 
5,6c5,6
< #ifndef MICROPY_INCLUDED_STM32L4XX_HAL_CONF_H
< #define MICROPY_INCLUDED_STM32L4XX_HAL_CONF_H
---
> #ifndef MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H
> #define MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H
8c8
< #include "boards/stm32l4xx_hal_conf_base.h"
---
> #include "boards/stm32f4xx_hal_conf_base.h"
11c11
< #define HSE_VALUE (8000000)
---
> #define HSE_VALUE (12000000)
13,14c13
< #define EXTERNAL_SAI1_CLOCK_VALUE (48000)
< #define EXTERNAL_SAI2_CLOCK_VALUE (48000)
---
> #define EXTERNAL_CLOCK_VALUE (12288000)
20c19
< #endif // MICROPY_INCLUDED_STM32L4XX_HAL_CONF_H
---
> #endif // MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H
rich@poseiden:~/micropython/ports/stm32/boards$ 

chrismas9
Posts: 152
Joined: Wed Jun 25, 2014 10:07 am

Re: Boot time is 10 seconds for a NUCLEO_L452RE build

Post by chrismas9 » Mon Jan 27, 2020 10:01 am

I just updated my build to latest, rebuilt mpy-cross, updated submodules and built NUCLEO_L452RE using WSL. the NUCLEO board boots immediately. I am using gcc 9.2.1 from ARM and WSL/UBUNTU 16.04.

Code: Select all

>>> MicroPython v1.12-96-gc3095b3 on 2020-01-27; NUCLEO-L452RE with STM32L452RE
Type "help()" for more information.

Code: Select all

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenial

Code: Select all

arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]

User avatar
RWLTOK
Posts: 53
Joined: Thu Dec 14, 2017 7:24 pm

Re: Boot time is 10 seconds for a NUCLEO_L452RE_P build

Post by RWLTOK » Sat Feb 15, 2020 4:02 pm

<scratching head> Ok... The ole "works on my machine". That is good to know. I am using an older compiler version and 18.03. Hmm. I actually have the NUCLEO_L452RE_P. This is the one with SMPS (low voltage core) support. I wonder if there is a different default clock speed. Even though I have it jumpered for 3.3V operation, I don't think the CPU knows that. Thanks for responding. I now have a place I can look for the cause.

I updated the subject to add the _P.

Rich

rruf
Posts: 6
Joined: Sat Mar 14, 2020 8:04 pm

Re: Boot time is 10 seconds for a NUCLEO_L452RE build

Post by rruf » Mon Apr 20, 2020 8:10 pm

Did you find a solution? I am having a similar problem here, although different chip: STM32F407VGT6 - also takes strangely long to boot up.

sheaff
Posts: 1
Joined: Wed Aug 05, 2020 12:52 pm

Re: Boot time is 10 seconds for a NUCLEO_L452RE build

Post by sheaff » Wed Aug 05, 2020 1:06 pm

I found that the user button is active high on the NUCLEO-L452RE-P board rather then active low. The micropython initializater executes update_reset_mode() because it thinks the user button is pressed (it's not). The pin configuration on the NUCLEO-L452RE-P was also different than the NUCLEO-L452RE. Multiple on board peripherals conflict with the SMPS on the board and are commented out. Here's my hacks.
mpconfigboard.h

Code: Select all

#define MICROPY_HW_BOARD_NAME       "NUCLEO-L452RE-P"
#define MICROPY_HW_MCU_NAME         "STM32L452RE"

#define MICROPY_PY_USOCKET          (0)
#define MICROPY_PY_NETWORK          (0)

#define MICROPY_HW_ENABLE_RTC       (1)
#define MICROPY_HW_ENABLE_RNG       (1)
#define MICROPY_HW_ENABLE_DAC       (1)
#define MICROPY_HW_ENABLE_SERVO     (0) // SERVO requires TIM5 (not on L452).
#define MICROPY_HW_HAS_SWITCH       (1)

// MSI is used and is 4MHz
#define MICROPY_HW_CLK_PLLM (1)
#define MICROPY_HW_CLK_PLLN (40)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV7)
#define MICROPY_HW_CLK_PLLQ (RCC_PLLQ_DIV2)
#define MICROPY_HW_CLK_PLLR (RCC_PLLR_DIV2)
#define MICROPY_HW_FLASH_LATENCY FLASH_LATENCY_4

// The board has an external 32kHz crystal
#define MICROPY_HW_RTC_USE_LSE      (1)

// UART config
#define MICROPY_HW_UART1_TX     (pin_B6)
#define MICROPY_HW_UART1_RX     (pin_B7)
#define MICROPY_HW_UART2_TX     (pin_A2)    // VCP TX
#define MICROPY_HW_UART2_RX     (pin_A3)    // VCP RX
#define MICROPY_HW_UART3_TX     (pin_C10)
#define MICROPY_HW_UART3_RX     (pin_C11)
#define MICROPY_HW_UART4_TX     (pin_A0)
#define MICROPY_HW_UART4_RX     (pin_A1)
// USART2 is connected to the ST-LINK USB VCP
#define MICROPY_HW_UART_REPL        PYB_UART_2
#define MICROPY_HW_UART_REPL_BAUD   115200

// I2C busses
#define MICROPY_HW_I2C1_SCL     (pin_B8)    // Arduino D15, pin 3 on CN10
#define MICROPY_HW_I2C1_SDA     (pin_B9)    // Arduino D14, pin 5 on CN10
#define MICROPY_HW_I2C2_SCL     (pin_B10)   // Arduino D6,  pin 25 on CN10
#define MICROPY_HW_I2C2_SDA     (pin_B11)   //              pin 18 on CN10
//#define MICROPY_HW_I2C3_SCL     (pin_A7)    //              pin 15 on CN10
//#define MICROPY_HW_I2C3_SDA     (pin_B4)    //              pin 27 on CN10
#define MICROPY_HW_I2C4_SCL     (pin_C0)    //              pin 38 on CN7
#define MICROPY_HW_I2C4_SDA     (pin_C1)    //              pin 36 on CN7

// SPI busses
//#define MICROPY_HW_SPI1_NSS     (pin_A15)   //              pin 17 on CN7
//#define MICROPY_HW_SPI1_SCK     (pin_A5)    // Arduino D13, pin 11 on CN10
//#define MICROPY_HW_SPI1_MISO    (pin_A6)    // Arduino D12, pin 13 on CN10
//#define MICROPY_HW_SPI1_MOSI    (pin_A7)    // Arduino D11, pin 15 on CN10
//#define MICROPY_HW_SPI2_NSS     (pin_B12)   //              pin 16 on CN10
//#define MICROPY_HW_SPI2_SCK     (pin_B13)   //              pin 30 on CN10
//#define MICROPY_HW_SPI2_MISO    (pin_B14)   //              pin 28 on CN10
//#define MICROPY_HW_SPI2_MOSI    (pin_B15)   //              pin 26 on CN10
//#define MICROPY_HW_SPI3_NSS     (pin_A4)    //              pin 32 on CN7
//#define MICROPY_HW_SPI3_SCK     (pin_C10)   //              pin 1 on CN7
//#define MICROPY_HW_SPI3_MISO    (pin_C11)   //              pin 2 on CN7
//#define MICROPY_HW_SPI3_MOSI    (pin_C12)   //              pin 3 on CN7

// CAN busses
#define MICROPY_HW_CAN1_TX (pin_B9)
#define MICROPY_HW_CAN1_RX (pin_B8)

// USER B1 has a pull-up and is active low
// NOT ON THIS BOARD - It's Active High (being pushed is high)
#define MICROPY_HW_USRSW_PIN        (pin_C13)
#define MICROPY_HW_USRSW_PULL       (0)
#define MICROPY_HW_USRSW_EXTI_MODE  (GPIO_MODE_IT_RISING)
#define MICROPY_HW_USRSW_PRESSED    (1)

// NUCLEO-64 has one user LED
#define MICROPY_HW_LED1             (pin_B13) // green
#define MICROPY_HW_LED_ON(pin)      (mp_hal_pin_high(pin))
#define MICROPY_HW_LED_OFF(pin)     (mp_hal_pin_low(pin))
pins.csv

Code: Select all

BOOT0,PH3
CN6_10,PB0
CN6_11,PC13
CN6_12,PA10
CN6_13,PB14
CN6_14,PA91
CN6_15,PB15
CN6_16,PB11
CN6_17,PA11
CN6_18,PB2
CN6_19,PA8
CN6_1,PC9
CN6_21,PB6
CN6_22,PB1
CN6_23,PC7
CN6_24,PA7
CN6_25,PB10
CN6_26,PA6
CN6_27,PA15
CN6_28,PA5
CN6_29,PB5
CN6_2,PC8
CN6_30,PA4
CN6_31,PB3
CN6_33,PA12
CN6_34,PC4
CN6_35,PA2
CN6_36,PA3
CN6_37,PA3
CN6_38,PA2
CN6_3,PB8
CN6_4,PC6
CN6_5,PB7
CN6_6,PC5
CN7_CS,PA11
CN7_D10,PA11
CN7_D11,PB15
CN7_D12,PB14
CN7_D13,PB13
CN7_D14,PB7
CN7_D15,PB8
CN7_D8,PB6
CN7_D9,PA8
CN7_MISO,PB14
CN7_MOSI,PB15
CN7_SCK,PB13
CN7_SCL,PB8
CN7_SDA,PB7
CN5_13,PB12
CN5_15,PA13
CN5_17,PA14
CN5_1,PC10
CN5_23,PC13
CN5_25,PC14
CN5_27,PC15
CN5_28,PA0
CN5_29,PH0
CN5_2,PC11
CN5_30,PA1
CN5_31,PH1
CN5_32,PC3
CN5_34,PC2
CN5_35,PB4
CN5_36,PC1
CN5_37,PB9
CN5_38,PC0
CN5_3,PC12
CN5_4,PD2
CN10_A0,PA0
CN10_A1,PA1
CN10_A2,PC3
CN10_A3,PC2
CN10_A4,PC1
CN10_A5,PC0
CN9_D0,PA3
CN9_D1,PA2
CN9_D2,PA12
CN9_D3,PB3
CN9_D4,PB5
CN9_D5,PA15
CN9_D6,PB10
CN9_D7,PC7
CN9_RX,PA3
CN9_TX,PA2
LED_GREEN,PC13
SWCLK,PA14
SWDIO,PA13
USER_B1,PC13

Post Reply