I have experience using the StdPeriph libraries for stm32 programming. But now I tried STM32Cube HAL with the STM32CubeMX code generator. I created a project with the following parameters:
- Middleware: FreeRTOS and FatFS via SDIO
- The compiler is GCC
- stm32f103ret6 MCU
I imported the generated code into an Eclipse environment. I made binary code and flashed it using "st-flash write ...", as usual. My test program successfully wrote "Hello" to USART1 in a loop - this is not a problem. But then, when I tried to flash another code, it failed with an “unknown id chip”. If I manually connect NRST to GND, st-flash gives:
...Flash: 0 bytes (0 KiB) in pages of 2048 bytes
Full conclusion:
2015-06-14T16:07:29 INFO src/stlink-common.c: Loading device parameters....
2015-06-14T16:07:29 INFO src/stlink-common.c: Device connected is: F1 High-density device, id 0x10036414
2015-06-14T16:07:29 INFO src/stlink-common.c: SRAM size: 0x10000 bytes (64 KiB), Flash: 0 bytes (0 KiB) in pages of 2048 bytes
ST-Link Windows, MCU ( stm32).
USART1, .
, , , . 2 MCU, .
MCU - ?