SlideShare una empresa de Scribd logo
1 de 16
Descargar para leer sin conexión
STM32-M4 First Touch
     Ben@staros.mobi
       2012/06/26
STM32F407VGT6




●    32-bit ARM® Cortex™-M4-based   USB for Input
     STM32-F4                        or ST-LINK
●    168MHz, upto 210 MIPS
●    1MB Flash, 192KB RAM
STM32F407VGT6 I/O




                    ●   ST-LINK
                    ●   Need to be licensed




                        USB 2.0
                         OTG
Toolchain for ® Cortex™-M4-based
codesourcery arm
● https://sourcery.mentor.com/GNUToolchain/
● arm-2012.03-56-arm-none-eabi-i686-pc-
  linux-gnu.tar.bz2


Summon-arm-toolchain
● https://github.com/MikeSmith/summon-arm-
  toolchain
● -mcpu=cortex-m4 -mthumb-interwork -
  mfloat-abi=hard -mfpu=fpv4-sp-d16 -
  mlittle-endian
Downloads
stm32
 ● https://github.com/nabilt/STM32F4-Discovery-Firmware

st-link
 ● git clone https://github.com/texane/stlink.git stlink

F4OS
 ● git clone git://github.com/prattmic/F4OS.git
    ○ 6/26 version include UART with hello example
compile stlink in ubuntu 11.04
sudo apt-get install autoconf
sh autogen.sh
./configure
(ps: require libusb-1.0.0)
make
(note: please don't install, just use it by
export PATH=~/stlink/:$PATH)
Install udev rules for ST-LINK device
$ cd stlink
$ sudo cp 49-stlink* /etc/udev/rules.d
st-flash
F4OS$ st-flash write ./os.bin 0x8000000
2012-06-11T08:56:21 INFO src/stlink-common.c: Loading device parameters....
2012-06-11T08:56:21 INFO src/stlink-common.c: Device connected is: F4 device, id
0x20006411
2012-06-11T08:56:21 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192
KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes
2012-06-11T08:56:21 INFO src/stlink-common.c: Attempting to write 18376 (0x47c8)
bytes to stm32 address: 134217728 (0x8000000)
EraseFlash - Sector:0x0 Size:0x4000
Flash page at addr: 0x08000000 erasedEraseFlash - Sector:0x1 Size:0x4000
Flash page at addr: 0x08004000 erased
2012-06-11T08:56:22 INFO src/stlink-common.c: Finished erasing 2 pages of 16384
(0x4000) bytes
2012-06-11T08:56:22 INFO src/stlink-common.c: Starting Flash write for F2/F4
2012-06-11T08:56:22 INFO src/stlink-common.c: Successfully loaded flash loader in
sram
size: 18376
2012-06-11T08:56:22 INFO src/stlink-common.c: Starting verification of write complete
2012-06-11T08:56:23 INFO src/stlink-common.c: Flash written and verified! jolly good!
st-util wait gdb
ben@xubuntu:~/src/github/stlink$ ./st-util
2012-06-10T22:56:32 INFO src/stlink-usb.c: -- exit_dfu_mode
2012-06-10T22:56:32 INFO src/stlink-common.c: Loading device parameters....
2012-06-10T22:56:32 INFO src/stlink-common.c: Device connected is: F4
device, id 0x20006411
2012-06-10T22:56:32 INFO src/stlink-common.c: SRAM size: 0x30000 bytes
(192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes
Chip ID is 00000413, Core ID is 2ba01477.
KARL - should read back as 0x03, not 60 02 00 00
init watchpoints
Listening at *:4242...
gdb with st-util
~/F4OS$ arm-none-eabi-gdb
GNU gdb (Sourcery CodeBench Lite 2012.03-56) 7.2.50.20100908-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-
eabi".
For bug reporting instructions, please see:
<https://support.codesourcery.com/GNUToolchain/>.
(gdb) target remote :4242
Remote debugging using :4242
0x007f3ff4 in ?? ()
Demo




STM32F407VGT6
Backlogs
Bus Blaster and OpenOCD
http://www.nabiltewolde.com/?tag=STM32F4


Bus Blaster and OpenOCD
 Warning: OpenOCD does not fully support the CortexM4 yet and this method
may damage your hardware. I am not an expert OpenOCD user. Use at your
own risk.

The Bus Blaster is an open hardware JTAG debugger made by Dangerous
Prototypes, which you can get for about $35 atSeeedStudio. Any debugger
compatible with Open On-Chip Debugger (OpenOCD) should work fine for
these instructions.
STM32F4 Adapter Board




SOURCE:Projects/stm32f4-adapter-board
Using the STM32F4 DISCOVERY Board in OSX Lion

http://www.nabiltewolde.com/using-the-stm32f4-discovery-
board-in/
STM32F407VGT6

 ●    microcontroller featuring 32-bit ARM Cortex-M4F core, 1 MB Flash, 192 KB
      RAM in an LQFP100 package
 ●    On-board ST-LINK/V2 with selection mode switch to use the kit as a
      standalone ST- LINK/V2 (with SWD connector for programming and
      debugging)
 ●    LIS302DL, ST MEMS motion sensor, 3-axis
 ●    digital output accelerometer
 ●    MP45DT02, ST MEMS audio sensor, omni- directional digital microphone
 ●    CS43L22, audio DAC with integrated class D speaker driver
 ●    Eight LEDs:
 ●    USB OTG FS with micro-AB connector
 ●    Extension header for all LQFP100 I/Os for quick connection to prototyping
      board and easy probing
More - reference DM00037955.pdf

Más contenido relacionado

La actualidad más candente

Arm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_armArm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_arm
Prashant Ahire
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
Basics of open source embedded development board (
Basics of open source embedded development board (Basics of open source embedded development board (
Basics of open source embedded development board (
Dhruwank Vankawala
 

La actualidad más candente (20)

Arm cortex-m4 programmer model
Arm cortex-m4 programmer modelArm cortex-m4 programmer model
Arm cortex-m4 programmer model
 
Introduction to AVR Microcontroller
Introduction to AVR Microcontroller Introduction to AVR Microcontroller
Introduction to AVR Microcontroller
 
What is Bootloader???
What is Bootloader???What is Bootloader???
What is Bootloader???
 
Arm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_armArm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_arm
 
Embedded systems basics
Embedded systems basicsEmbedded systems basics
Embedded systems basics
 
Embedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 CourseEmbedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 Course
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
UART
UART UART
UART
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 
ESP8266 Wifi Nodemcu
ESP8266 Wifi Nodemcu ESP8266 Wifi Nodemcu
ESP8266 Wifi Nodemcu
 
Introduction to ARM LPC2148
Introduction to ARM LPC2148Introduction to ARM LPC2148
Introduction to ARM LPC2148
 
Introduction to arm architecture
Introduction to arm architectureIntroduction to arm architecture
Introduction to arm architecture
 
Arm Processors Architectures
Arm Processors ArchitecturesArm Processors Architectures
Arm Processors Architectures
 
PIC Microcontrollers
PIC MicrocontrollersPIC Microcontrollers
PIC Microcontrollers
 
Tinkercad Workshop PPT, Dept. of ECE.pptx
Tinkercad Workshop PPT, Dept. of ECE.pptxTinkercad Workshop PPT, Dept. of ECE.pptx
Tinkercad Workshop PPT, Dept. of ECE.pptx
 
Basics of open source embedded development board (
Basics of open source embedded development board (Basics of open source embedded development board (
Basics of open source embedded development board (
 
Introduction to embedded systems
Introduction  to embedded systemsIntroduction  to embedded systems
Introduction to embedded systems
 
PIC 16F877A by PARTHIBAN. S.
PIC 16F877A   by PARTHIBAN. S.PIC 16F877A   by PARTHIBAN. S.
PIC 16F877A by PARTHIBAN. S.
 
Architecture of pentium family
Architecture of pentium familyArchitecture of pentium family
Architecture of pentium family
 
Esp8266 NodeMCU
Esp8266 NodeMCUEsp8266 NodeMCU
Esp8266 NodeMCU
 

Destacado

使用Eclipse快樂的mruby開發
使用Eclipse快樂的mruby開發使用Eclipse快樂的mruby開發
使用Eclipse快樂的mruby開發
yamanekko
 
STM32F4 for 智慧型電動輪椅系統Part1
STM32F4 for 智慧型電動輪椅系統Part1STM32F4 for 智慧型電動輪椅系統Part1
STM32F4 for 智慧型電動輪椅系統Part1
Jack Wang
 
Slide ghep kenh_so0126_384
Slide ghep kenh_so0126_384Slide ghep kenh_so0126_384
Slide ghep kenh_so0126_384
Kiem Phong
 
Bài tập nguyên lý máy
Bài tập nguyên lý máyBài tập nguyên lý máy
Bài tập nguyên lý máy
Nguyen Van Phuong
 

Destacado (19)

Certified USB-C & Power Delivery Solution based on STM32
Certified USB-C & Power Delivery Solution based on STM32Certified USB-C & Power Delivery Solution based on STM32
Certified USB-C & Power Delivery Solution based on STM32
 
présentation STM32
présentation STM32présentation STM32
présentation STM32
 
Malaysia stm
Malaysia stmMalaysia stm
Malaysia stm
 
使用Eclipse快樂的mruby開發
使用Eclipse快樂的mruby開發使用Eclipse快樂的mruby開發
使用Eclipse快樂的mruby開發
 
How to control physical devices with mruby
How to control physical devices with mrubyHow to control physical devices with mruby
How to control physical devices with mruby
 
JavaScript and Internet Controlled Electronics
JavaScript and Internet Controlled ElectronicsJavaScript and Internet Controlled Electronics
JavaScript and Internet Controlled Electronics
 
STM32F4 for 智慧型電動輪椅系統Part1
STM32F4 for 智慧型電動輪椅系統Part1STM32F4 for 智慧型電動輪椅系統Part1
STM32F4 for 智慧型電動輪椅系統Part1
 
Programming The Arduino Due in Rust
Programming The Arduino Due in RustProgramming The Arduino Due in Rust
Programming The Arduino Due in Rust
 
Let's Play STM32
Let's Play STM32Let's Play STM32
Let's Play STM32
 
Embedded Rust – Rust on IoT devices
Embedded Rust – Rust on IoT devicesEmbedded Rust – Rust on IoT devices
Embedded Rust – Rust on IoT devices
 
Embedded Rust on IoT devices
Embedded Rust on IoT devicesEmbedded Rust on IoT devices
Embedded Rust on IoT devices
 
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDevLearn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
Learn How to Develop Embedded System for ARM @ 2014.12.22 JuluOSDev
 
Slide ghep kenh_so0126_384
Slide ghep kenh_so0126_384Slide ghep kenh_so0126_384
Slide ghep kenh_so0126_384
 
Rust: Systems Programming for Everyone
Rust: Systems Programming for EveryoneRust: Systems Programming for Everyone
Rust: Systems Programming for Everyone
 
STM32 F4 (PWM,SPI And ADC Test Examples)
STM32 F4 (PWM,SPI And ADC Test Examples)STM32 F4 (PWM,SPI And ADC Test Examples)
STM32 F4 (PWM,SPI And ADC Test Examples)
 
2016-09-eclipse-iot-cf-summit
2016-09-eclipse-iot-cf-summit2016-09-eclipse-iot-cf-summit
2016-09-eclipse-iot-cf-summit
 
Track 2 session 5 - st dev con 2016-usb type c with pd
Track 2   session 5 - st dev con 2016-usb type c with pdTrack 2   session 5 - st dev con 2016-usb type c with pd
Track 2 session 5 - st dev con 2016-usb type c with pd
 
Bài tập nguyên lý máy
Bài tập nguyên lý máyBài tập nguyên lý máy
Bài tập nguyên lý máy
 
Track 2 session 2 - st dev con 2016 - stm32 open development environment
Track 2   session 2 - st dev con 2016 - stm32 open development  environmentTrack 2   session 2 - st dev con 2016 - stm32 open development  environment
Track 2 session 2 - st dev con 2016 - stm32 open development environment
 

Similar a Stm32 f4 first touch

Share the Experience of Using Embedded Development Board
Share the Experience of Using Embedded Development BoardShare the Experience of Using Embedded Development Board
Share the Experience of Using Embedded Development Board
Jian-Hong Pan
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answers
ProfessorLance
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answers
ProfessorLance
 
Functional MCU programming #0: Development environment
Functional MCU programming #0: Development environmentFunctional MCU programming #0: Development environment
Functional MCU programming #0: Development environment
Kiwamu Okabe
 

Similar a Stm32 f4 first touch (20)

Real practice of Networking design on specialized for ARM Cortex-M
Real practice of Networking design on specialized for ARM Cortex-MReal practice of Networking design on specialized for ARM Cortex-M
Real practice of Networking design on specialized for ARM Cortex-M
 
Share the Experience of Using Embedded Development Board
Share the Experience of Using Embedded Development BoardShare the Experience of Using Embedded Development Board
Share the Experience of Using Embedded Development Board
 
Deploy STM32 family on Zephyr - SFO17-102
Deploy STM32 family on Zephyr - SFO17-102Deploy STM32 family on Zephyr - SFO17-102
Deploy STM32 family on Zephyr - SFO17-102
 
JS Fest 2018. Володимир Шиманський. Запуск двіжка JS на мікроконтролері
JS Fest 2018. Володимир Шиманський. Запуск двіжка JS на мікроконтролеріJS Fest 2018. Володимир Шиманський. Запуск двіжка JS на мікроконтролері
JS Fest 2018. Володимир Шиманський. Запуск двіжка JS на мікроконтролері
 
Embedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debuggingEmbedded Recipes 2019 - Introduction to JTAG debugging
Embedded Recipes 2019 - Introduction to JTAG debugging
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021
 
OpenOCD-K3
OpenOCD-K3OpenOCD-K3
OpenOCD-K3
 
Hardwear.io 2018 BLE Security Essentials workshop
Hardwear.io 2018 BLE Security Essentials workshopHardwear.io 2018 BLE Security Essentials workshop
Hardwear.io 2018 BLE Security Essentials workshop
 
建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card
 
STM -32
STM -32STM -32
STM -32
 
learning STM -32
learning STM -32 learning STM -32
learning STM -32
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answers
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answers
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
Ghosterr
GhosterrGhosterr
Ghosterr
 
Experiences with Oracle SPARC S7-2 Server
Experiences with Oracle SPARC S7-2 ServerExperiences with Oracle SPARC S7-2 Server
Experiences with Oracle SPARC S7-2 Server
 
Hardware hacking
Hardware hackingHardware hacking
Hardware hacking
 
ChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPad
 
Functional MCU programming #0: Development environment
Functional MCU programming #0: Development environmentFunctional MCU programming #0: Development environment
Functional MCU programming #0: Development environment
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 

Más de Benux Wei (8)

F9 microkernel app development part 2 gpio meets led
F9 microkernel app development part 2 gpio meets ledF9 microkernel app development part 2 gpio meets led
F9 microkernel app development part 2 gpio meets led
 
F9 microkernel app development part 1
F9 microkernel app development part 1F9 microkernel app development part 1
F9 microkernel app development part 1
 
F9 microkernel code reading part 4 memory management
F9 microkernel code reading part 4 memory managementF9 microkernel code reading part 4 memory management
F9 microkernel code reading part 4 memory management
 
F9 Microkernel code reading part 2 scheduling
F9 Microkernel code reading part 2 schedulingF9 Microkernel code reading part 2 scheduling
F9 Microkernel code reading part 2 scheduling
 
While software engineer meets 3d printer
While software engineer meets 3d printerWhile software engineer meets 3d printer
While software engineer meets 3d printer
 
F9 Microkernel code reading - part 1
F9 Microkernel code reading - part 1F9 Microkernel code reading - part 1
F9 Microkernel code reading - part 1
 
Tdd with python unittest for embedded c
Tdd with python unittest for embedded cTdd with python unittest for embedded c
Tdd with python unittest for embedded c
 
Preparation for mit ose lab4
Preparation for mit ose lab4Preparation for mit ose lab4
Preparation for mit ose lab4
 

Último

Último (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Stm32 f4 first touch

  • 1. STM32-M4 First Touch Ben@staros.mobi 2012/06/26
  • 2. STM32F407VGT6 ● 32-bit ARM® Cortex™-M4-based USB for Input STM32-F4 or ST-LINK ● 168MHz, upto 210 MIPS ● 1MB Flash, 192KB RAM
  • 3. STM32F407VGT6 I/O ● ST-LINK ● Need to be licensed USB 2.0 OTG
  • 4. Toolchain for ® Cortex™-M4-based codesourcery arm ● https://sourcery.mentor.com/GNUToolchain/ ● arm-2012.03-56-arm-none-eabi-i686-pc- linux-gnu.tar.bz2 Summon-arm-toolchain ● https://github.com/MikeSmith/summon-arm- toolchain ● -mcpu=cortex-m4 -mthumb-interwork - mfloat-abi=hard -mfpu=fpv4-sp-d16 - mlittle-endian
  • 5. Downloads stm32 ● https://github.com/nabilt/STM32F4-Discovery-Firmware st-link ● git clone https://github.com/texane/stlink.git stlink F4OS ● git clone git://github.com/prattmic/F4OS.git ○ 6/26 version include UART with hello example
  • 6. compile stlink in ubuntu 11.04 sudo apt-get install autoconf sh autogen.sh ./configure (ps: require libusb-1.0.0) make (note: please don't install, just use it by export PATH=~/stlink/:$PATH)
  • 7. Install udev rules for ST-LINK device $ cd stlink $ sudo cp 49-stlink* /etc/udev/rules.d
  • 8. st-flash F4OS$ st-flash write ./os.bin 0x8000000 2012-06-11T08:56:21 INFO src/stlink-common.c: Loading device parameters.... 2012-06-11T08:56:21 INFO src/stlink-common.c: Device connected is: F4 device, id 0x20006411 2012-06-11T08:56:21 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes 2012-06-11T08:56:21 INFO src/stlink-common.c: Attempting to write 18376 (0x47c8) bytes to stm32 address: 134217728 (0x8000000) EraseFlash - Sector:0x0 Size:0x4000 Flash page at addr: 0x08000000 erasedEraseFlash - Sector:0x1 Size:0x4000 Flash page at addr: 0x08004000 erased 2012-06-11T08:56:22 INFO src/stlink-common.c: Finished erasing 2 pages of 16384 (0x4000) bytes 2012-06-11T08:56:22 INFO src/stlink-common.c: Starting Flash write for F2/F4 2012-06-11T08:56:22 INFO src/stlink-common.c: Successfully loaded flash loader in sram size: 18376 2012-06-11T08:56:22 INFO src/stlink-common.c: Starting verification of write complete 2012-06-11T08:56:23 INFO src/stlink-common.c: Flash written and verified! jolly good!
  • 9. st-util wait gdb ben@xubuntu:~/src/github/stlink$ ./st-util 2012-06-10T22:56:32 INFO src/stlink-usb.c: -- exit_dfu_mode 2012-06-10T22:56:32 INFO src/stlink-common.c: Loading device parameters.... 2012-06-10T22:56:32 INFO src/stlink-common.c: Device connected is: F4 device, id 0x20006411 2012-06-10T22:56:32 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes Chip ID is 00000413, Core ID is 2ba01477. KARL - should read back as 0x03, not 60 02 00 00 init watchpoints Listening at *:4242...
  • 10. gdb with st-util ~/F4OS$ arm-none-eabi-gdb GNU gdb (Sourcery CodeBench Lite 2012.03-56) 7.2.50.20100908-cvs Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none- eabi". For bug reporting instructions, please see: <https://support.codesourcery.com/GNUToolchain/>. (gdb) target remote :4242 Remote debugging using :4242 0x007f3ff4 in ?? ()
  • 13. Bus Blaster and OpenOCD http://www.nabiltewolde.com/?tag=STM32F4 Bus Blaster and OpenOCD Warning: OpenOCD does not fully support the CortexM4 yet and this method may damage your hardware. I am not an expert OpenOCD user. Use at your own risk. The Bus Blaster is an open hardware JTAG debugger made by Dangerous Prototypes, which you can get for about $35 atSeeedStudio. Any debugger compatible with Open On-Chip Debugger (OpenOCD) should work fine for these instructions.
  • 15. Using the STM32F4 DISCOVERY Board in OSX Lion http://www.nabiltewolde.com/using-the-stm32f4-discovery- board-in/
  • 16. STM32F407VGT6 ● microcontroller featuring 32-bit ARM Cortex-M4F core, 1 MB Flash, 192 KB RAM in an LQFP100 package ● On-board ST-LINK/V2 with selection mode switch to use the kit as a standalone ST- LINK/V2 (with SWD connector for programming and debugging) ● LIS302DL, ST MEMS motion sensor, 3-axis ● digital output accelerometer ● MP45DT02, ST MEMS audio sensor, omni- directional digital microphone ● CS43L22, audio DAC with integrated class D speaker driver ● Eight LEDs: ● USB OTG FS with micro-AB connector ● Extension header for all LQFP100 I/Os for quick connection to prototyping board and easy probing More - reference DM00037955.pdf