3337 views|3 replies

1663

Posts

0

Resources
The OP
 

Tutorial on porting STM32 program to MM32 [Copy link]

 This post was last edited by Hot Ximixiu on 2021-6-23 08:18

For users who are new to MM32 MCU, they may encounter the situation that the MCU cannot be downloaded, and then report that there is a problem with the chip. Finally, after follow-up by technical engineers, it is actually caused by user program errors or improper operations, not chip problems. If you encounter this situation, please don't worry. In this article, Lingdong Micro's general agent Yingshang Microelectronics specifically explains how to solve the problem of failed programming and the possible reasons for such problems.

There are many reasons why MM32 cannot be burned. We analyze it from two aspects: hardware and software:

Hardware reasons:
1. The debugger used does not support debugging and downloading MM32 MCU. The emulator selection/configuration on IAR/KEIL is incorrect. MM32 MCU has been officially certified by Segger. On the Segger official website, J-Link driver version 6.40 and above supports the MM32 MCU series. MM32 MCU supports MM32-Link, U-link, J-Link, DAP-Link, etc., using SWD/JTAG (M3) and other methods to access the core, peripherals, and FLASH.

2. If the minimum system of MM32 MCU is incomplete, the reset circuit design is wrong, the MCU power supply is abnormal, etc., the device cannot be recognized. MM32 MCU supports a wide voltage of 2.0-5.5v power supply. When users design the product PCB themselves, it is recommended that users reserve VCC, SWDIO, SWCLK, GND, and NRST five-wire download port mode. Please refer to the demo board for circuit design.

3. The two pins PA13 and PA14 of SWD are poorly soldered, the external hardware is pulled up or down, the connection with the debugger is incorrect or not connected, etc.

Software reasons:
1. Program download error. MM32 MCU has five series: F, L, SPIN, W, and P. We have different libraries, startup files, and routines for different MCUs. Before downloading the program, please check whether your MCU version model corresponds to the program to be downloaded. For example, MM32F031C6T6 is divided into version q and version n. The two models have different clock domain configurations, so the programs cannot be directly shared.

2. The MCU is in read/write protection state. When the MCU is in read protection state, the FLASH space is in write protection state. At this time, the SWD protocol cannot be used to access the core, peripherals, and FLASH, and download and debugging cannot be performed.

3. The MCU is in a low-power state. When the MCU is in a low-power state in different modes, the peripheral area of the MCU will be in a power-off state. The debugger recognizes that the MCU is in a power-off state and cannot be downloaded and debugged.

4. The two pins PA13 and PA14 of SWD are multiplexed as other functions or general IO, and PA13 and PA14 are configured as other working modes. At this time, PA13 and PA14 cannot work normally in SWD mode, and the debugger cannot download and debug through the SWD protocol.

5. An error occurred during program download. Due to reasons such as download speed and debugger version characteristics, an error occurred during the download process, causing the MCU to enter the HardFault state (program runaway), and download debugging is not possible at this time.

I would like to share a tutorial on how to port STM32 programs to MM32. I hope it can be helpful to everyone.

MM32移植教程.zip (4.79 MB, downloads: 122)

This post is from Domestic Chip Exchange

Latest reply

Thanks for sharing!   Details Published on 2021-6-24 21:54
 
 

53

Posts

0

Resources
2
 

Newbie, learning

This post is from Domestic Chip Exchange
 
 
 

693

Posts

7

Resources
3
 

Recommend a useful SWD mode download tool:

This post is from Domestic Chip Exchange
 
 
 

7422

Posts

2

Resources
4
 

Thanks for sharing!

This post is from Domestic Chip Exchange
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list