Skip to content

Commit f6d4ccd

Browse files
committed
Merge branch 'esp32' into dev-wdt
2 parents 784ceb8 + a9517c0 commit f6d4ccd

File tree

1,749 files changed

+16158
-446209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,749 files changed

+16158
-446209
lines changed

.gitattributes

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@
1515
# These should also not be modified by git.
1616
tests/basics/string_cr_conversion.py -text
1717
tests/basics/string_crlf_conversion.py -text
18-
stmhal/pybcdc.inf_template -text
19-
stmhal/usbd_* -text
20-
stmhal/boards/*/stm32f4xx_hal_conf.h -text
21-
stmhal/cmsis/** -text
22-
stmhal/hal/** -text
23-
stmhal/usbdev/** -text
24-
stmhal/usbhost/** -text
25-
cc3200/hal/aes.c -text
26-
cc3200/hal/aes.h -text
27-
cc3200/hal/des.c -text
28-
cc3200/hal/i2s.c -text
29-
cc3200/hal/i2s.h -text
30-
cc3200/version.h -text
18+
ports/stm32/pybcdc.inf_template -text
19+
ports/stm32/usbd_* -text
20+
ports/stm32/boards/*/stm32f4xx_hal_conf.h -text
21+
ports/stm32/usbdev/** -text
22+
ports/stm32/usbhost/** -text
23+
ports/cc3200/hal/aes.c -text
24+
ports/cc3200/hal/aes.h -text
25+
ports/cc3200/hal/des.c -text
26+
ports/cc3200/hal/i2s.c -text
27+
ports/cc3200/hal/i2s.h -text
28+
ports/cc3200/version.h -text

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*.dis
1010
*.exe
1111

12-
# Packages
12+
# Packages
1313
############
1414

1515
# Logs and Databases

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@
1111
[submodule "lib/berkeley-db-1.xx"]
1212
path = lib/berkeley-db-1.xx
1313
url = https://github.com/pfalcon/berkeley-db-1.xx
14+
[submodule "lib/stm32lib"]
15+
path = lib/stm32lib
16+
url = https://github.com/micropython/stm32lib
17+
branch = work-F4-1.13.1+F7-1.5.0+L4-1.3.0

.travis.yml

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,47 +20,48 @@ before_script:
2020
# For teensy build
2121
- sudo apt-get install realpath
2222
# For coverage testing
23-
- sudo pip install cpp-coveralls
23+
# cpp-coveralls 0.4 conflicts with urllib3 preinstalled in Travis VM
24+
- sudo pip install cpp-coveralls==0.3.12
2425
- gcc --version
2526
- arm-none-eabi-gcc --version
2627
- python3 --version
2728

2829
script:
2930
- make -C mpy-cross
30-
- make -C minimal CROSS=1 build/firmware.bin
31-
- ls -l minimal/build/firmware.bin
31+
- make -C ports/minimal CROSS=1 build/firmware.bin
32+
- ls -l ports/minimal/build/firmware.bin
3233
- tools/check_code_size.sh
3334
- mkdir -p ${HOME}/persist
3435
# Save new firmware for reference, but only if building a main branch, not a pull request
35-
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cp minimal/build/firmware.bin ${HOME}/persist/; fi'
36-
- make -C unix deplibs
37-
- make -C unix
38-
- make -C unix nanbox
39-
- make -C bare-arm
40-
- make -C qemu-arm test
41-
- make -C stmhal
42-
- make -C stmhal BOARD=PYBV11 MICROPY_PY_WIZNET5K=1 MICROPY_PY_CC3K=1
43-
- make -C stmhal BOARD=STM32F7DISC
44-
- make -C stmhal BOARD=STM32L476DISC
45-
- make -C teensy
46-
- make -C cc3200 BTARGET=application BTYPE=release
47-
- make -C cc3200 BTARGET=bootloader BTYPE=release
48-
- make -C windows CROSS_COMPILE=i686-w64-mingw32-
36+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cp ports/minimal/build/firmware.bin ${HOME}/persist/; fi'
37+
- make -C ports/unix deplibs
38+
- make -C ports/unix
39+
- make -C ports/unix nanbox
40+
- make -C ports/bare-arm
41+
- make -C ports/qemu-arm test
42+
- make -C ports/stm32
43+
- make -C ports/stm32 BOARD=PYBV11 MICROPY_PY_WIZNET5K=1 MICROPY_PY_CC3K=1
44+
- make -C ports/stm32 BOARD=STM32F769DISC
45+
- make -C ports/stm32 BOARD=STM32L476DISC
46+
- make -C ports/teensy
47+
- make -C ports/cc3200 BTARGET=application BTYPE=release
48+
- make -C ports/cc3200 BTARGET=bootloader BTYPE=release
49+
- make -C ports/windows CROSS_COMPILE=i686-w64-mingw32-
4950

5051
# run tests without coverage info
5152
#- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests)
5253
#- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests --emit native)
5354

5455
# run tests with coverage info
55-
- make -C unix coverage
56-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests)
57-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests -d thread)
58-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests --emit native)
59-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests --via-mpy -d basics float)
56+
- make -C ports/unix coverage
57+
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests)
58+
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -d thread)
59+
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --emit native)
60+
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --via-mpy -d basics float)
6061

6162
# run coveralls coverage analysis (try to, even if some builds/tests failed)
62-
- (cd unix && coveralls --root .. --build-root . --gcov $(which gcov) --gcov-options '\-o build-coverage/' --include py --include extmod)
63+
- (cd ports/unix && coveralls --root ../.. --build-root . --gcov $(which gcov) --gcov-options '\-o build-coverage/' --include py --include extmod)
6364

6465
after_failure:
6566
- (cd tests && for exp in *.exp; do testbase=$(basename $exp .exp); echo -e "\nFAILURE $testbase"; diff -u $testbase.exp $testbase.out; done)
66-
- (grep "FAIL" qemu-arm/build/console.out)
67+
- (grep "FAIL" ports/qemu-arm/build/console.out)

CODECONVENTIONS.md

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,28 @@ a change in a detail, if needed. Any change beyond 5 lines would likely
2424
require such detailed description.
2525

2626
To get good practical examples of good commits and their messages, browse
27-
thry the `git log` of the project.
27+
the `git log` of the project.
28+
29+
MicroPython doesn't require explicit sign-off for patches ("Signed-off-by"
30+
lines and similar). Instead, the commit message, and your name and email
31+
address on it construes your sign-off of the following:
32+
33+
* That you wrote the change yourself, or took it from a project with
34+
a compatible license (in the latter case the commit message, and possibly
35+
source code should provide reference where the implementation was taken
36+
from and give credit to the original author, as required by the license).
37+
* That you are allowed to release these changes to an open-source project
38+
(for example, changes done during paid work for a third party may require
39+
explicit approval from that third party).
40+
* That you (or your employer) agree to release the changes under
41+
MicroPython's license, which is the MIT license. Note that you retain
42+
copyright for your changes (for smaller changes, the commit message
43+
conveys your copyright; if you make significant changes to a particular
44+
source module, you're welcome to add your name to the file header).
45+
* Your signature for all of the above, which is the 'Author' line in
46+
the commit message, and which should include your full real name and
47+
a valid and active email address by which you can be contacted in the
48+
foreseeable future.
2849

2950
Python code conventions
3051
=======================
@@ -52,7 +73,7 @@ White space:
5273
keyword and the opening parenthesis.
5374
- Put 1 space after a comma, and 1 space around operators.
5475

55-
Braces:
76+
Braces:
5677
- Use braces for all blocks, even no-line and single-line pieces of
5778
code.
5879
- Put opening braces on the end of the line it belongs to, not on
@@ -114,3 +135,76 @@ Type declarations:
114135
int member;
115136
void *data;
116137
} my_struct_t;
138+
139+
Documentation conventions
140+
=========================
141+
142+
MicroPython generally follows CPython in documentation process and
143+
conventions. reStructuredText syntax is used for the documention.
144+
145+
Specific conventions/suggestions:
146+
147+
* Use `*` markup to refer to arguments of a function, e.g.:
148+
149+
```
150+
.. method:: poll.unregister(obj)
151+
152+
Unregister *obj* from polling.
153+
```
154+
155+
* Use following syntax for cross-references/cross-links:
156+
157+
```
158+
:func:`foo` - function foo in current module
159+
:func:`module1.foo` - function foo in module "module1"
160+
(similarly for other referent types)
161+
:class:`Foo` - class Foo
162+
:meth:`Class.method1` - method1 in Class
163+
:meth:`~Class.method1` - method1 in Class, but rendered just as "method1()",
164+
not "Class.method1()"
165+
:meth:`title <method1>` - reference method1, but render as "title" (use only
166+
if really needed)
167+
:mod:`module1` - module module1
168+
169+
`symbol` - generic xref syntax which can replace any of the above in case
170+
the xref is unambiguous. If there's ambiguity, there will be a warning
171+
during docs generation, which need to be fixed using one of the syntaxes
172+
above
173+
```
174+
175+
* Cross-referencing arbitrary locations
176+
~~~
177+
.. _xref_target:
178+
179+
Normal non-indented text.
180+
181+
This is :ref:`reference <xref_target>`.
182+
183+
(If xref target is followed by section title, can be just
184+
:ref:`xref_target`).
185+
~~~
186+
187+
* Linking to external URL:
188+
```
189+
`link text <http://foo.com/...>`_
190+
```
191+
192+
* Referencing builtin singleton objects:
193+
```
194+
``None``, ``True``, ``False``
195+
```
196+
197+
* Use following syntax to create common description for more than one element:
198+
~~~
199+
.. function:: foo(x)
200+
bar(y)
201+
202+
Description common to foo() and bar().
203+
~~~
204+
205+
206+
More detailed guides and quickrefs:
207+
208+
* http://www.sphinx-doc.org/en/stable/rest.html
209+
* http://www.sphinx-doc.org/en/stable/markup/inline.html
210+
* http://docutils.sourceforge.net/docs/user/rst/quickref.html

README.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,36 @@ Builtin modules include `sys`, `time`, and `struct`, etc. Select ports have
4747
support for `_thread` module (multithreading). Note that only a subset of
4848
Python 3 functionality is implemented for the data types and modules.
4949

50-
See the repository www.github.com/micropython/pyboard for the MicroPython
50+
MicroPython can execute scripts in textual source form or from precompiled
51+
bytecode, in both cases either from an on-device filesystem or "frozen" into
52+
the MicroPython executable.
53+
54+
See the repository http://github.com/micropython/pyboard for the MicroPython
5155
board (PyBoard), the officially supported reference electronic circuit board.
5256

5357
Major components in this repository:
5458
- py/ -- the core Python implementation, including compiler, runtime, and
5559
core library.
56-
- unix/ -- a version of MicroPython that runs on Unix.
57-
- stmhal/ -- a version of MicroPython that runs on the PyBoard and similar
60+
- mpy-cross/ -- the MicroPython cross-compiler which is used to turn scripts
61+
into precompiled bytecode.
62+
- ports/unix/ -- a version of MicroPython that runs on Unix.
63+
- ports/stm32/ -- a version of MicroPython that runs on the PyBoard and similar
5864
STM32 boards (using ST's Cube HAL drivers).
59-
- minimal/ -- a minimal MicroPython port. Start with this if you want
65+
- ports/minimal/ -- a minimal MicroPython port. Start with this if you want
6066
to port MicroPython to another microcontroller.
6167
- tests/ -- test framework and test scripts.
6268
- docs/ -- user documentation in Sphinx reStructuredText format. Rendered
6369
HTML documentation is available at http://docs.micropython.org (be sure
6470
to select needed board/port at the bottom left corner).
6571

6672
Additional components:
67-
- bare-arm/ -- a bare minimum version of MicroPython for ARM MCUs. Used
73+
- ports/bare-arm/ -- a bare minimum version of MicroPython for ARM MCUs. Used
6874
mostly to control code size.
69-
- teensy/ -- a version of MicroPython that runs on the Teensy 3.1
75+
- ports/teensy/ -- a version of MicroPython that runs on the Teensy 3.1
7076
(preliminary but functional).
71-
- pic16bit/ -- a version of MicroPython for 16-bit PIC microcontrollers.
72-
- cc3200/ -- a version of MicroPython that runs on the CC3200 from TI.
73-
- esp8266/ -- an experimental port for ESP8266 WiFi modules.
77+
- ports/pic16bit/ -- a version of MicroPython for 16-bit PIC microcontrollers.
78+
- ports/cc3200/ -- a version of MicroPython that runs on the CC3200 from TI.
79+
- ports/esp8266/ -- an experimental port for ESP8266 WiFi modules.
7480
- extmod/ -- additional (non-core) modules implemented in C.
7581
- tools/ -- various tools, including the pyboard.py module.
7682
- examples/ -- a few example Python scripts.
@@ -91,7 +97,7 @@ Alternatively, fallback implementation based on setjmp/longjmp can be used.
9197

9298
To build (see section below for required dependencies):
9399

94-
$ cd unix
100+
$ cd ports/unix
95101
$ make axtls
96102
$ make
97103

@@ -134,33 +140,33 @@ these additional dependencies, first fetch git submodules for them:
134140
$ git submodule update --init
135141

136142
Use this same command to get the latest versions of dependencies, as
137-
they are updated from time to time. After that, in `unix/` dir, execute:
143+
they are updated from time to time. After that, in `ports/unix/` dir, execute:
138144

139145
$ make deplibs
140146

141147
This will build all available dependencies (regardless whether they
142148
are used or not). If you intend to build MicroPython with additional
143149
options (like cross-compiling), the same set of options should be passed
144150
to `make deplibs`. To actually enabled use of dependencies, edit
145-
`unix/mpconfigport.mk` file, which has inline descriptions of the options.
151+
`ports/unix/mpconfigport.mk` file, which has inline descriptions of the options.
146152
For example, to build SSL module (required for `upip` tool described above),
147153
set `MICROPY_PY_USSL` to 1.
148154

149-
In `unix/mpconfigport.mk`, you can also disable some dependencies enabled
155+
In `ports/unix/mpconfigport.mk`, you can also disable some dependencies enabled
150156
by default, like FFI support, which requires libffi development files to
151157
be installed.
152158

153-
The STM version
154-
---------------
159+
The STM32 version
160+
-----------------
155161

156-
The "stmhal" port requires an ARM compiler, arm-none-eabi-gcc, and associated
162+
The "stm32" port requires an ARM compiler, arm-none-eabi-gcc, and associated
157163
bin-utils. For those using Arch Linux, you need arm-none-eabi-binutils and
158164
arm-none-eabi-gcc packages. Otherwise, try here:
159165
https://launchpad.net/gcc-arm-embedded
160166

161167
To build:
162168

163-
$ cd stmhal
169+
$ cd ports/stm32
164170
$ make
165171

166172
You then need to get your board into DFU mode. On the pyboard, connect the
@@ -174,4 +180,4 @@ Then to flash the code via USB DFU to your device:
174180
This will use the included `tools/pydfu.py` script. If flashing the firmware
175181
does not work it may be because you don't have the correct permissions, and
176182
need to use `sudo make deploy`.
177-
See the README.md file in the stmhal/ directory for further details.
183+
See the README.md file in the ports/stm32/ directory for further details.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy