Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
MicroPython Projects

You're reading from  MicroPython Projects

Product type Book
Published in Apr 2020
Publisher Packt
ISBN-13 9781789958034
Pages 294 pages
Edition 1st Edition
Languages
Author (1):
Jacob Beningo Jacob Beningo
Profile icon Jacob Beningo

Table of Contents (14) Chapters

Preface Down the Rabbit Hole with MicroPython Managing Real-Time Tasks Writing a MicroPython Driver for an I/O Expander Developing an Application Test Harness Customizing the MicroPython Kernel Start Up Code A Custom Debugging Tool to Visualize Sensor Data Device Control Using Gestures Automation and Control Using Android Building an Object Detection Application Using Machine Learning The Future of MicroPython Downloading and Running MicroPython Code
Assessments Other Books You May Enjoy

Navigating the startup code

The startup code for the STM32 port can be found in main.c, which is located in the micropython/ports/stm32 directory. This folder also contains the code for various peripheral modules. In order to make heads or tails of the startup code, I recommend that you open main.c and locate the stm32_main function. stm32_main contains the initialization sequence for MicroPython.

In addition to stm32_main.c, the main.c module also contains several additional functions that are used to support the system startup. The support code in main.c includes additional initialization for items such as the following:

  • A flash error state code
  • A filesystem reset code, such as creating default main.py and boot.py files
  • Filesystem initialization
  • SD card initialization

The initialization sequence is not complicated, but it does contain quite a few steps. When I encounter a...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}