Proj-2013-2014-Python-STM32F4: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 37: | Line 37: | ||
* STM32 develop environment |
* STM32 develop environment |
||
Add USB device |
'''Add USB device''' |
||
Create a new udev rule in /etc/udev/rules.d/45-usb-stlink-v2.rules: |
Create a new udev rule in /etc/udev/rules.d/45-usb-stlink-v2.rules: |
||
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="3748", MODE="660", GROUP="plugdev" |
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="3748", MODE="660", GROUP="plugdev" |
||
To reboot : |
To reboot : |
||
$ sudo service udev restart |
$ sudo service udev restart |
||
Download the GNU/ARM toolchain |
'''Download the GNU/ARM toolchain''' |
||
Download the Linux current installation tarball from |
Download the Linux current installation tarball from |
||
https://launchpad.net/gcc-arm-embedded/+download |
https://launchpad.net/gcc-arm-embedded/+download |
||
Line 55: | Line 55: | ||
Maybe it is caused by the difference between 32bit and 64bit system. Try : |
Maybe it is caused by the difference between 32bit and 64bit system. Try : |
||
$ sudo apt-get install ia32-libs* |
$ sudo apt-get install ia32-libs* |
||
Download and Build STLINK |
'''Download and Build STLINK''' |
||
STLINK is for programming and debugging firmware. |
STLINK is for programming and debugging firmware. |
||
you'll first need to install a couple of packages: |
you'll first need to install a couple of packages: |
||
Line 99: | Line 99: | ||
Status |
Status |
||
1) dahl@ubuntu:~/Desktop/3/stlink/example/32l_lcd$ make write |
'''1)''' dahl@ubuntu:~/Desktop/3/stlink/example/32l_lcd$ make write |
||
../../flash/flash write lcd.bin 0x08000000 |
../../flash/flash write lcd.bin 0x08000000 |
||
2012-02-09T23:25:54 INFO src/stlink-common.c: Loading device parameters.... |
2012-02-09T23:25:54 INFO src/stlink-common.c: Loading device parameters.... |
||
Line 106: | Line 106: | ||
make: *** [write] Error 255 |
make: *** [write] Error 255 |
||
2) ./st-util |
'''2)''' ./st-util |
||
2012-02-25T16:00:42 INFO src/stlink-common.c: Loading device parameters.... |
2012-02-25T16:00:42 INFO src/stlink-common.c: Loading device parameters.... |
||
2012-02-25T16:00:42 WARN src/stlink-common.c: unknown chip id! 0xe0042000 |
2012-02-25T16:00:42 WARN src/stlink-common.c: unknown chip id! 0xe0042000 |
||
Line 115: | Line 115: | ||
Listening at *:4242... |
Listening at *:4242... |
||
3) dahl@ubuntu:~/Desktop/3/stlink/example/32l_lcd$ ../../flash/flash erase |
'''3)''' dahl@ubuntu:~/Desktop/3/stlink/example/32l_lcd$ ../../flash/flash erase |
||
2012-02-09T23:28:01 INFO src/stlink-common.c: Loading device parameters.... |
2012-02-09T23:28:01 INFO src/stlink-common.c: Loading device parameters.... |
||
2012-02-09T23:28:01 WARN src/stlink-common.c: unknown chip id! 0xe0042000 |
2012-02-09T23:28:01 WARN src/stlink-common.c: unknown chip id! 0xe0042000 |
||
Mass erasing |
Mass erasing |
||
4) If I hold the Reset button while erasing: |
'''4)''' If I hold the Reset button while erasing: |
||
ahl@ubuntu:~/Desktop/3/stlink/example/32l_lcd$ ../../flash/flash erase |
ahl@ubuntu:~/Desktop/3/stlink/example/32l_lcd$ ../../flash/flash erase |
||
2012-02-09T23:28:28 INFO src/stlink-common.c: Loading device parameters.... |
2012-02-09T23:28:28 INFO src/stlink-common.c: Loading device parameters.... |
||
Line 127: | Line 127: | ||
Mass erasing |
Mass erasing |
||
5) If I hold the Reset button while flashing: |
'''5)''' If I hold the Reset button while flashing: |
||
dahl@ubuntu:~/Desktop/3/stlink/example/32l_lcd$ make write |
dahl@ubuntu:~/Desktop/3/stlink/example/32l_lcd$ make write |
||
../../flash/flash write lcd.bin 0x08000000 |
../../flash/flash write lcd.bin 0x08000000 |
Revision as of 16:15, 9 February 2014
Introduction
Team
- Tutors : Olivier Richard
- Members : TAO Xinxiu , XIA Ye
Objectives
Points à traiter
- Modidification des Makefile
utilisation de arm-none-eabi-g++ et des bonnes options
- support STL
Voir https://github.com/andysworkshop/stm32plus
- Lib C
Voir newlib
- gc Garbage Collection
Voir tinygc http://tinygc.sourceforge.net/
- libprce
Voir T-Rex is a minimalistic regular expression http://tiny-rex.sourceforge.net/ http://sourceforge.net/projects/tiny-rex/
Progress
project start : 13/01/2014
Week 1 (13/01 - 19/01)
- Project discovery
- Research of related projects
Week 2 (20/01 - 26/01)
- STM32 develop environment
Add USB device Create a new udev rule in /etc/udev/rules.d/45-usb-stlink-v2.rules: SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="3748", MODE="660", GROUP="plugdev" To reboot : $ sudo service udev restart Download the GNU/ARM toolchain Download the Linux current installation tarball from https://launchpad.net/gcc-arm-embedded/+download $ tar -xvjf gcc-arm-none-eabi-xxxxxxxxxxxxxxxxxx-linux.tar.bz2 Add the fallowing to your ~/.bashrc export PATH=$PATH:~/xxxxxxx/gcc-arm-none-eabi-xxxxxxxxx/bin $ source ~/.bashrc To check : $ arm-none-eabi-gcc --version If you get an error message “bash : ... file does not exist”. Maybe it is caused by the difference between 32bit and 64bit system. Try : $ sudo apt-get install ia32-libs* Download and Build STLINK STLINK is for programming and debugging firmware. you'll first need to install a couple of packages: $ sudo apt-get install autoconf pkg-config libusb-1.0 git Retrieve a copy of the STLINK source: $ git clone https://github.com/texane/stlink.git Build the code following the instructions in the README, with: $ ./autogen.sh $ ./configure $ make As a sanity check, look in ~/st-link and you should see st-util, st-flash, etc... You may check if the board could be connected by execute st-util. If it does not work please confirm if the rule you added in the first step corresponds your system.
- Try the official examples of ST on the cards
To avoid using the commercial software IDE and understand better, We decided to develop on Linux for this project. During the tries, for certain examples, we've got different results on STM32F407 and STM32F401. We choose STM32F407 as the hardware for the following developement.
Week 3 (27/01 - 02/02)
- Test Project MicroPython
- Test Project Shedskin
- STM32 hardware
Week 4 (02/02 - 09/02)
- STM32 breakdown situation & solution
Status 1) dahl@ubuntu:~/Desktop/3/stlink/example/32l_lcd$ make write ../../flash/flash write lcd.bin 0x08000000 2012-02-09T23:25:54 INFO src/stlink-common.c: Loading device parameters.... 2012-02-09T23:25:54 WARN src/stlink-common.c: unknown chip id! 0 stlink_sram_flash() == -1 make: *** [write] Error 255 2) ./st-util 2012-02-25T16:00:42 INFO src/stlink-common.c: Loading device parameters.... 2012-02-25T16:00:42 WARN src/stlink-common.c: unknown chip id! 0xe0042000 2012-02-25T16:00:42 INFO src/stlink-sg.c: Successfully opened a stlink v1 debugger Chip ID is 00000000, Core ID is 00000000. KARL - should read back as 0x03, not 60 02 00 00 init watchpoints Listening at *:4242... 3) dahl@ubuntu:~/Desktop/3/stlink/example/32l_lcd$ ../../flash/flash erase 2012-02-09T23:28:01 INFO src/stlink-common.c: Loading device parameters.... 2012-02-09T23:28:01 WARN src/stlink-common.c: unknown chip id! 0xe0042000 Mass erasing
4) If I hold the Reset button while erasing: ahl@ubuntu:~/Desktop/3/stlink/example/32l_lcd$ ../../flash/flash erase 2012-02-09T23:28:28 INFO src/stlink-common.c: Loading device parameters.... 2012-02-09T23:28:28 INFO src/stlink-common.c: Device connected is: L1 Med-density device, id 0x10386416 2012-02-09T23:28:28 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0 bytes (0 KiB) in pages of 256 bytes Mass erasing 5) If I hold the Reset button while flashing: dahl@ubuntu:~/Desktop/3/stlink/example/32l_lcd$ make write ../../flash/flash write lcd.bin 0x08000000 2012-02-10T14:13:21 INFO src/stlink-common.c: Loading device parameters.... 2012-02-10T14:13:21 INFO src/stlink-common.c: Device connected is: L1 Med-density device, id 0x10386416 2012-02-10T14:13:21 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 256 bytes 2012-02-10T14:13:21 INFO src/stlink-common.c: Attempting to write 7332 (0x1ca4) bytes to stm32 address: 134217728 (0x8000000) 2012-02-10T14:13:21 WARN src/stlink-common.c: pecr.pelock not clear (0x7) 2012-02-10T14:13:21 WARN src/stlink-common.c: Failed to erase_flash_page(0x8000000) == -1 stlink_fwrite_flash() == -1 make: *** [write] Error 255