2114 views|13 replies

6

Posts

0

Resources
The OP
 

How to transplant MicroPython on Apollo F767 [Copy link]

 
 

As the title says, I have tried for many days but failed to transplant, and the virtual serial port and virtual disk of mpy never appeared. The compiled file is modified according to f767zi, and the clock frequency should be correct. Then the burning method is to use stm32cubeprog to burn the compiled hex file into it, and the connection method is stlink. However, after the burning is completed, the virtual serial port and disk did not appear. Because I don’t understand the serial port, I would like to ask the following questions: 1. Is it only necessary to connect stlink during and after the transplantation process? Because some tutorials say that after the successful transplantation, the stlink connection will become a virtual serial port, and some tutorials require connecting both USBs on the board to the computer. 2. What is the function of MICROPY_HW_USB_VBUS_DETECT_PIN in the .h file in the compiled file? Some tutorials say that the port inside must be connected to 3.3v to recognize the USB, which is basically PA9, but even though I connected it to 3.3v, the virtual serial port and disk did not appear. 3. Every time I change the .h file, an error will be reported, saying that the added pin is undefined. Is this definition in the .csv file? Why are some pins in the original .h file, such as PA9, not in the .csv file? 4. Is there any difference between burning hex files with stlink, burning hex files with usb to serial port, and burning dfu files with dfuse Demo? 5. If the reason for the failure of the transplantation lies in the .h file and .csv file, what other problems are likely to cause failure besides the clock frequency? 6. In addition to file modification, what are the steps or operations that are easy to make mistakes or be ignored during the transplantation process? I have to submit a report in the next day. I sincerely ask all the masters to answer my questions. Thank you very much (save the child, I am going crazy)

Latest reply

The .h file specifies the GPIOs that can be used.   Details Published on 2022-3-24 11:43
 
 

1w

Posts

25

Resources
2
 
  1. The virtual disk pybflash and virtual serial port cdc must be connected to the STM32's own USB interface, and cannot use stlink's USB. In addition,
    #define MICROPY_HW_ENABLE_USB (1) needs to be defined in mpconfigboard.h.
  2. MICROPY_HW_USB_VBUS_DETECT_PIN is the hardware USB connection detection pin, which is detected by connecting the pin to VBUS. If no pin is connected to VBUS, this function needs to be disabled. The default is PA9, which is also the pin specified by STM32, and other pins can also be used.
  3. Generally, pins are defined in pins.cvs, which is equivalent to the alias of the pins.
  4. Either method can be used to download files. The difference is that stlink will overwrite the previous content and cannot retain the pybflash disk content, while dfu can retain it.
  5. Compilation failed, look at the error prompts and find the cause according to the prompts

Comments

#define MICROPY_HW_ENABLE_USB (1) has already been defined. "Connect to STM32's own USB interface". Does this refer to the USB 232 to serial port on the development board or the USB slave or both? I don't know much about STM32.  Details Published on 2022-3-23 20:50
 
 
 

1w

Posts

25

Resources
3
 

You can look up previous transplantation experience posts in this section of the forum. Although they are transplanted to other chips, they can also serve as a reference.

 
 
 

2w

Posts

74

Resources
4
 

For example: https://en.eeworld.com/bbs/thread-1127334-1-1.html You can search it.

Add and join groups EEWorld service account EEWorld subscription account Automotive development circle

Comments

I tried this when I first started learning about transplantation, including some other transplantations. But I still couldn't transplant successfully.   Details Published on 2022-3-23 20:51
Personal signature

加油!在电子行业默默贡献自己的力量!:)

 
 
 

6

Posts

0

Resources
5
 
dcexpert posted on 2022-3-23 16:29 The virtual disk pybflash and virtual serial port cdc must be connected to the STM32's own USB interface, and cannot use stlink's USB. And mpconfigboard.h ...

#define MICROPY_HW_ENABLE_USB (1) has already been defined

"Connecting to the STM32's own USB interface" does this mean the USB 232 to serial port on the development board or the USB slave or both. I don't know much about stm32

Comments

Of course, it is the USBOTG interface of STM32 itself, that is, PA11/PA12. USB serial port cannot simulate a USB flash drive.  Details Published on 2022-3-23 21:32
 
 
 

6

Posts

0

Resources
6
 
soso posted on 2022-3-23 16:39 For example: https://en.eeworld.com/bbs/thread-1127334-1-1.html You can search it.

I tried this when I first started learning about transplantation, including some other transplantations. But I still couldn't transplant successfully.

Comments

There are actually not many tricks, just follow the instructions and try them many times, and check each step carefully. Start with the official examples and compare them more.  Details Published on 2022-3-23 21:38
 
 
 

1w

Posts

25

Resources
7
 
Posted by Little Coconut by the Sea on 2022-3-23 20:50 #define MICROPY_HW_ENABLE_USB (1) Already defined''Connect to STM32's own USB interface...

Of course, it is the USBOTG interface of STM32 itself, that is, PA11/PA12. USB serial port cannot simulate a USB flash drive.

Comments

"USB to serial port cannot simulate a USB flash drive" woke me up. Now the transplantation is successful. Thank you very much (kowtow)  Details Published on 2022-3-24 00:55
 
 
 

1w

Posts

25

Resources
8
 
Posted by Little Coconut by the Sea on 2022-3-23 20:51 I tried this when I first started learning about transplantation, including some other transplantations. But I still couldn't transplant successfully

There are actually not many tricks, just follow the instructions and try them out more often, and check each step carefully. Start with the official examples and compare them more.

Comments

Boss, I have another question about the two sides of the csv file. The left side is the defined pin name and the right side is the actual pin of the chip, right? So for example, if I have a light connected to PF9, then I can just add led1 PF9 to the csv, right? Then in the programming, should I write to make pf9 go high or led1 go high?  Details Published on 2022-3-24 01:44
 
 
 

6

Posts

0

Resources
9
 
dcexpert published on 2022-3-23 21:32 Of course it is the USBOTG interface of STM32 itself, that is, PA11/PA12. USB serial port cannot simulate a USB flash drive.

"USB to serial port cannot simulate a USB flash drive" woke me up. Now the transplantation is successful. Thank you very much (kowtow)

 
 
 

6

Posts

0

Resources
10
 
dcexpert posted on 2022-3-23 21:38 Actually there are not many tricks, just follow the instructions and try more, check each step carefully. Start with the official examples and compare them more

Boss, I have another question about the two sides of the csv file. The left side is the defined pin name and the right side is the actual pin of the chip, right? So for example, if I have a light connected to PF9, then I can just add led1 PF9 to the csv, right? Then in the programming, should I write to make pf9 high or led1 high? I don't quite understand the relationship between the pin settings in the csv file and the pin usage in the programming.

Comments

cvs is just an alias, it doesn't matter whether it is there or not. For example, the definition of pybv10 is X1,PA0 X2,PA1 ... Y15,3.3V Y16,VIN SW,PB3 LED_RED,PA13 LED_GREEN,PA14 LED_YELLOW,PA15 LED_BLUE,PB4 MMA_INT,PB2 MMA_  Details Published on 2022-3-24 08:19
 
 
 

1w

Posts

25

Resources
11
 
Posted by Little Coconut by the Sea on 2022-3-24 01:44 Boss, I have another question about the two sides of the csv file. The left side is the definition of the pin name and the right side is the actual pin of the chip, right? So for example...

cvs is just an alias, it doesn't matter whether it is there or not. For example, the definition of pybv10


X1,PA0
X2,PA1

...

Y15,3.3V
Y16,VIN
SW,PB3
LED_RED,PA13
LED_GREEN,PA14
LED_YELLOW,PA15
LED_BLUE,PB4

MMA_INT,PB2
MMA_AVDD,PB5
SD_D0,PC8
SD_D1,PC9
SD_D2,PC10
SD_D3,PC11
SD_CMD,PD2
SD_CK,PC12
SD,PA8
SD_SW,PA8
USB_VBUS,PA9
USB_ID,PA10
USB_DM,PA11
USB_DP,PA12


The left side is the name (alias), and the right side is the pin. In actual use, both are acceptable and have the same effect.

Comments

Thanks for your advice. That is to say, the pins used in micropython do not need to be defined in the csv file, but do the pins that appear in .h need to be defined?  Details Published on 2022-3-24 11:35
 
 
 

6742

Posts

2

Resources
12
 

I ported it once last time and encountered many problems, but I ported F429, which has relatively more tutorials.

 
 
 

6

Posts

0

Resources
13
 
dcexpert posted on 2022-3-24 08:19 cvs is just an alias, it doesn't matter whether it is there or not. For example, the definition of pybv10 is X1,PA0 X2,PA1 ... Y15,3 ...

Thanks for your advice. That is to say, the pins used in micropython do not need to be defined in the csv file, but do the pins that appear in .h need to be defined?

Comments

The .h file specifies the GPIOs that can be used.  Details Published on 2022-3-24 11:43
 
 
 

1w

Posts

25

Resources
14
 
Posted by Little Coconut by the Sea on 2022-3-24 11:35 Thank you for the advice. That is to say, the pins used in micropython do not need to be defined in the csv file, but the pins that appear in .h...

The .h file specifies the GPIOs that can be used.

 
 
 

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