Files
micropython/docs
Volodymyr Shymanskyy 51976110e2 tools/mpy_ld.py: Allow linking static libraries.
This commit introduces an additional symbol resolution mechanism to the
natmod linking process.  This allows the build scripts to look for required
symbols into selected libraries that are provided by the compiler
installation (libgcc and libm at the moment).

For example, using soft-float code in natmods, whilst technically possible,
was not an easy process and required some additional work to pull it off.
With this addition all the manual (and error-prone) operations have been
automated and folded into `tools/mpy_ld.py`.

Both newlib and picolibc toolchains are supported, albeit the latter may
require a bit of extra configuration depending on the environment the build
process runs on.  Picolibc's soft-float functions aren't in libm - in fact
the shipped libm is nothing but a stub - but they are inside libc.  This is
usually not a problem as these changes cater for that configuration quirk,
but on certain compilers the include paths used to find libraries in may
not be updated to take Picolibc's library directory into account.  The bare
metal RISC-V compiler shipped with the CI OS image (GCC 10.2.0 on Ubuntu
22.04LTS) happens to exhibit this very problem.

To work around that for CI builds, the Picolibc libraries' path is
hardcoded in the Makefile directives used by the linker, but this can be
changed by setting the PICOLIBC_ROOT environment library when building
natmods.

Signed-off-by: Volodymyr Shymanskyy <vshymanskyi@gmail.com>
Co-authored-by: Alessandro Gatti <a.gatti@frob.it>
2025-03-17 13:03:27 +11:00
..

MicroPython Documentation

The MicroPython documentation can be found at: http://docs.micropython.org/en/latest/

The documentation you see there is generated from the files in the docs tree: https://github.com/micropython/micropython/tree/master/docs

Building the documentation locally

If you're making changes to the documentation, you may want to build the documentation locally so that you can preview your changes.

Install Sphinx, and optionally (for the RTD-styling), sphinx_rtd_theme, preferably in a virtualenv:

 pip install sphinx
 pip install sphinx_rtd_theme

In micropython/docs, build the docs:

make html

You'll find the index page at micropython/docs/build/html/index.html.

Having readthedocs.org build the documentation

If you would like to have docs for forks/branches hosted on GitHub, GitLab or BitBucket an alternative to building the docs locally is to sign up for a free https://readthedocs.org account. The rough steps to follow are:

  1. sign-up for an account, unless you already have one
  2. in your account settings: add GitHub as a connected service (assuming you have forked this repo on github)
  3. in your account projects: import your forked/cloned micropython repository into readthedocs
  4. in the project's versions: add the branches you are developing on or for which you'd like readthedocs to auto-generate docs whenever you push a change

PDF manual generation

This can be achieved with:

make latexpdf

but requires a rather complete install of LaTeX with various extensions. On Debian/Ubuntu, try (1GB+ download):

apt install texlive-latex-recommended texlive-latex-extra texlive-xetex texlive-fonts-extra cm-super xindy