Skip to content

Commit

Permalink
Large amount of changes and additions
Browse files Browse the repository at this point in the history
The official name of this port is now 'MicroPython for K210'
  - all refferences to 'maixpy' are removed

Build system
  - most port specific options can now be configured using menuconfig
  - added --menuconfig option to BUILD.sh
  - build on Mac OSX and arm platforms is now supported and toolchains provided

Changed memory management support
  - if not using KPU, full 8 MB of memory can be used

Updated 'kflash.py' with https://github.com/loboris/ktool
  - new flash tool name is 'ktool.py', but the old name 'fflash.py' can still be used

FreeRTOS updated
  - many improvements
  - added 'mbedtls' library
  - added 'heap_5' support

Using two MicroPython instances improved
  - better inter-instances communication

SPI Flash support, including internal file system improved
  - SPI Flash speed can be changed from MicroPython
  - added methods for reading Flash chip JEDEC ID and unique ID

MicroPython modules improved, some bugs fixed, new modules added
  - almost all modules improved
  - 'Display' module:
    - added support for ePaper displays
    - added support for hershey vector fonts
    - added PNG support
  - Network support improved
  - 'machine' module:
    - added functions 'state', 'sramread', 'addrof', 'k210_id', 'flash_serial', 'flash_speed'
  - added 'camera' module with full support for OV2640 and OV5640
  - added 'ulab' module
  • Loading branch information
loboris committed Jan 28, 2020
1 parent 1abe503 commit 9d99740
Show file tree
Hide file tree
Showing 343 changed files with 158,316 additions and 3,700 deletions.
32 changes: 27 additions & 5 deletions .cproject
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@

<listOptionValue builtIn="false" value="&quot;${PWD}/k210-freertos/platform/sdk/kendryte-freertos-sdk/lib/freertos/include&quot;"/>

<listOptionValue builtIn="false" value="&quot;${PWD}/k210-freertos/platform/sdk/kendryte-freertos-sdk/lib/utils/include&quot;"/>

<listOptionValue builtIn="false" value="&quot;${PWD}/k210-freertos/platform/sdk/kendryte-freertos-sdk/lib/drivers/include&quot;"/>

<listOptionValue builtIn="false" value="&quot;${PWD}/k210-freertos/platform/sdk/kendryte-freertos-sdk/third_party/fatfs/source&quot;"/>
Expand All @@ -70,6 +72,8 @@
<listOptionValue builtIn="false" value="&quot;${PWD}/kendryte-toolchain/riscv64-unknown-elf/include&quot;"/>

<listOptionValue builtIn="false" value="&quot;${PWD}/kendryte-toolchain/lib/gcc/riscv64-unknown-elf/8.2.0/include&quot;"/>

<listOptionValue builtIn="false" value="&quot;${PWD}/kendryte-toolchain/lib/gcc/riscv64-unknown-elf/8.3.0/include&quot;"/>

</option>

Expand Down Expand Up @@ -122,6 +126,8 @@
<listOptionValue builtIn="false" value="&quot;${PWD}/kendryte-toolchain/riscv64-unknown-elf/include&quot;"/>

<listOptionValue builtIn="false" value="&quot;${PWD}/kendryte-toolchain/lib/gcc/riscv64-unknown-elf/8.2.0/include&quot;"/>

<listOptionValue builtIn="false" value="&quot;${PWD}/kendryte-toolchain/lib/gcc/riscv64-unknown-elf/8.3.0/include&quot;"/>

</option>

Expand Down Expand Up @@ -231,8 +237,6 @@

<buildCommand>${PWD}/k210-freertos/BUILD.sh</buildCommand>

<buildArguments/>

<stopOnError>true</stopOnError>

<useDefaultCommand>false</useDefaultCommand>
Expand All @@ -245,6 +249,8 @@

<buildCommand>${PWD}/k210-freertos/CLEAN.sh</buildCommand>

<buildArguments/>

<stopOnError>true</stopOnError>

<useDefaultCommand>false</useDefaultCommand>
Expand All @@ -271,7 +277,9 @@

<buildCommand>${PWD}/k210-freertos/BUILD.sh</buildCommand>

<buildArguments>-j8</buildArguments>
<buildArguments>-j16</buildArguments>

<buildTarget/>

<stopOnError>true</stopOnError>

Expand All @@ -285,7 +293,9 @@

<buildCommand>${PWD}/k210-freertos/BUILD.sh</buildCommand>

<buildArguments>-v -j8</buildArguments>
<buildArguments>-v -j16</buildArguments>

<buildTarget/>

<stopOnError>true</stopOnError>

Expand All @@ -301,7 +311,19 @@

<buildArguments>-d -j8</buildArguments>

<buildTarget/>
<stopOnError>true</stopOnError>

<useDefaultCommand>false</useDefaultCommand>

<runAllBuilders>true</runAllBuilders>

</target>

<target name="Menuconfig" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">

<buildCommand>mate-terminal</buildCommand>

<buildArguments>--working-directory="${PWD}k210-freertos" -e "./BUILD.sh --menuconfig" &amp;</buildArguments>

<stopOnError>true</stopOnError>

Expand Down
2 changes: 1 addition & 1 deletion .project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MaixPy-FreeRTOS</name>
<name>MicroPython_K210_LoBo</name>
<comment></comment>
<projects>
</projects>
Expand Down
2 changes: 2 additions & 0 deletions .settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>

<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>

<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>

</extension>
Expand Down
6 changes: 5 additions & 1 deletion firmware/MPyTerm.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self, baudrate=115200, device='/dev/ttyUSB0', rst=0, clr=False):
self.DEVICE = device
self.BAUDRATE = baudrate
self.ESCAPECHAR = "\033"
self.VERSION = "5.1.3"
self.VERSION = "5.1.4"
self.ShutdownReceiver = False
self.ReceiverToStdout = True
self.DefaultTimeout = 0.1
Expand Down Expand Up @@ -102,6 +102,10 @@ def __init__(self, baudrate=115200, device='/dev/ttyUSB0', rst=0, clr=False):
self.uart.dtr = True
else:
self.uart.write(b'\r\n')
time.sleep(0.1)
#self.uart.dtr = False
#self.uart.rts = False
#time.sleep(0.1)

except Exception as e:
raise Exception(self.TCLR['RED']+"Accessing "+self.TCLR['WHITE'] + self.DEVICE + " "+self.TCLR['RED']+"failed\r\n"+self.TCLR['WHITE']+"PyTerm exit"+self.TCLR['NORMAL']+"\r\n")
Expand Down
Binary file removed firmware/MaixPy.bin
Binary file not shown.
Binary file removed firmware/MaixPy.kfpkg
Binary file not shown.
Binary file removed firmware/MaixPy_firmware.zip
Binary file not shown.
Binary file removed firmware/MaixPy_sqlite.bin
Binary file not shown.
Binary file removed firmware/MaixPy_sqlite.kfpkg
Binary file not shown.
Binary file added firmware/MicroPython.bin
Binary file not shown.
Binary file added firmware/MicroPython.kfpkg
Binary file not shown.
Binary file added firmware/MicroPython_firmwares.zip
Binary file not shown.
16 changes: 10 additions & 6 deletions firmware/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# MicroPython for Kendryte K210


Three prebuilt firmwares are provided:

* `default` default configuration, no sqlite module, one MicroPython task; in this directory
* `sqlite` default configuration, sqlite module included, one MicroPython task; in `sqlite` directory
* `twotasks` no KPU (8 MB SRAM used), sqlite module included, two MicroPython task; in `twotasks` directory

To flash the pre-built firmware to your K210 board, run (in this directory):

```
./kflash.py -p /dev/ttyUSB0 -b 2000000 -t MaixPy.bin
./kflash.py -p /dev/ttyUSB0 -b 2000000 -t MicroPython.bin
```

Change */dev/ttyUSB0* to the port used to connect to the board if needed.<br>
`MaixPy.bin` is the default firmware name. Other firmware names can be used.

Two firmwares are provided, one with sqlite3 compiled and one without it.<br>
You can replace `MicroPython.bin` with `sqlite/MicroPython.bin` or `twotasks/MicroPython.bin` to flash another firmware.

`MaixPy.kfpkg` is also provided which contains prebuilt LittleFS internal file system.<br>
To flash it, just replace `MaixPy.bin` with `MaixPy.fpkg`.
`MicroPython.kfpkg` is also provided which contains prebuilt LittleFS internal file system.<br>
To flash it, just replace `MicroPython.bin` with `MicroPython.kfpkg`.

1,491 changes: 973 additions & 518 deletions firmware/kflash.py

Large diffs are not rendered by default.

Loading

0 comments on commit 9d99740

Please sign in to comment.