Machine B-L475E-IOT01A USART devices not functional
Host environment
-
Operating system: Alpine Linux v3.20
-
OS/kernel version: Linux alpine 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 Linux
-
Architecture: x86_64
-
QEMU flavor: qemu-system-arm
-
QEMU version: QEMU emulator version 9.0.2
-
QEMU command line:
qemu-system-arm -M b-l475e-iot01a -serial stdio -kernel ../STM_b-l475e-iot01a_Build/arm-cortex-qemu-demo.bin
Emulated/Virtualized environment
- Operating system: Bare metal
- OS/kernel version: Bare metal
- Architecture: ARM Cortex-M4
Description of problem
The B-L475E-IOT01A claims to support STM32L4x5 USARTs, UARTs and LPUART (Serial ports) but does not appear to actually function.
I created a minimal bare metal binary that attempts to write to UART (via printf) but it does not succeed. While debugging it appears that all UART registers for USART1 are zero despite code that is writing to those registers and USART_ISR should have the default value of 0x020000C0 per STM documentation RM0351. The code ends up in an infinite loop waiting for the USART module to become ready but it never does.
For comparison an almost identical program compiled for the netduino-plus-2 (also an STM32 Cortex-M4 CPU) is able to use USART succesfully.
Steps to reproduce
- Clone https://github.com/satur9nine/arm-cortex-qemu-demo/tree/STM_b-l475e-iot01a (note branch is STM_b-l475e-iot01a)
- Obtain arm-none-eabi-gcc version 13.3.rel1 or higher from ARM or linux package manager and install
- Go to
STM_b-l475e-iot01a_Buildand runmake allto produce arm-cortex-qemu-demo.bin - Run command provided above (optionally run with additional
-gdb tcp::1234,ipv4 -Soptions and attach debugger), observe there is no UART output - Repeat steps but with
STM_netduino-plus-2_Buildand observe UART output is produced for comparison
Additional information
Notice memory located at 0x40013800 which is where USART1 is located shows all zeros.
