Commit Graph

75 Commits

Author SHA1 Message Date
Scott Shawcroft d189a3f3cf atmel-samd: Support auto-reset based on USB write activity.
It will soft-reboot micropython after a burst of writes to the
file system. This means that after you save files on your computer
they will be automatically rerun.

This can be disabled in the build by unsetting AUTORESET_TIMER in
mpconfigboard.h.

Using the REPL will also prevent the soft resets until you reset
with CTRL-D manually.
2016-10-25 18:36:37 -07:00
Scott Shawcroft 614c1fdba2 atmel-samd: Only output to USB after DTR and don't send anything larger than the room left in the USB TX buffer. 2016-10-25 18:29:04 -07:00
Scott Shawcroft b7768a74a7 atmel-samd: Fix file system init.
Adding the USB write protection prevented file system reset from
working. Since it happens before USB start we temporarily set the
volume to writeable and then set it back to read-only before USB is
started.
2016-10-25 15:13:43 -07:00
Scott Shawcroft d05299f57a atmel-samd: Add D13 led as mass storage write indicator. 2016-10-25 15:06:05 -07:00
Scott Shawcroft 3a5aad516a atmel-samd: Remove unused header. 2016-10-25 15:04:20 -07:00
Scott Shawcroft fff96a0ce6 atmel-samd: Fix include guard. 2016-10-25 15:03:22 -07:00
Scott Shawcroft 16584dfee6 atmel-samd: Fix the Feather builds by switching to the VFS mass storage implementation. 2016-10-24 12:42:09 -07:00
Scott Shawcroft f5ca66805b atmel-samd: Tweak DAC logic for clarity. Thanks @bcr for the suggestion. 2016-10-21 17:08:14 -07:00
Scott Shawcroft b2834c30a6 atmel-samd: Support reading from the flash cache. 2016-10-21 16:04:18 -07:00
Scott Shawcroft 98c8f2f6a3 atmel-samd: Update the FatFs sector cache on USB mass storage write
to the same sector.

This fixes #20, the issue where a listdir or import won't work
without a reset when it was run before the file was copied.
2016-10-21 15:44:10 -07:00
Scott Shawcroft b8ef783052 extmod: Fix getting sector size when the max and min sizes are the
same.

Also switch the max size back to 512 for atmel-samd to save ram.
2016-10-21 15:44:10 -07:00
Scott Shawcroft 9eb86e8015 Add support for USB writeable, MicroPython read-only volumes.
This prevents file system corruption due to two systems mutating
it at once.
2016-10-21 15:44:09 -07:00
Scott Shawcroft eb62d03e33 atmel-samd: Add flash write activity LED. 2016-10-21 15:44:09 -07:00
Scott Shawcroft 8b1526e95e atmel-samd: Add a heap based cache for writing to flash.
The code will fallback to the flash scratch space when the GC
cannot allocate us enough memory.
2016-10-21 15:44:09 -07:00
Scott Shawcroft bb1822faea atmel-samd: Support external flash on the Metro M0 w/Flash.
This uses a scratch flash sector to save data before writing a full sector.
2016-10-21 15:44:09 -07:00
Scott Shawcroft 46f6f9f899 atmel-samd: Start USB at the end so storage is initialized. 2016-10-21 15:44:09 -07:00
Scott Shawcroft aacb1adcd1 atmel-samd: Add linker file for bootloaderless board with external flash. 2016-10-21 15:44:08 -07:00
Scott Shawcroft 853e5fc652 atmel-samd: Ensure at least 2k is left for the stack. 2016-10-21 15:43:24 -07:00
Scott Shawcroft 306c921ed1 atmel-samd: Rework mass storage interaction with underlying block
storage to use micropython's VFS interface.

This makes mass storage work with any VFS implementation rather
than a single one.
2016-10-21 15:36:59 -07:00
Tony DiCola f539312af3 atmel-samd: Enable framebuffer for SSD1306 and other displays. 2016-10-20 23:10:28 +00:00
Tony DiCola 5333f5f987 atmel-samd: Enable full urandom module from extmod. 2016-10-20 06:41:21 +00:00
Sebastian Plamauer 9b1170a65d [atmel-samd] add adalogger board definitions 2016-10-19 10:02:01 +02:00
Scott Shawcroft cb99ae5032 atmel-samd: Rename Feather M0 Bluefruit files to Feather M0 Basic because there isn't anything Bluefruit specific yet. 2016-10-14 13:10:17 -07:00
Scott Shawcroft 343ff4faed atmel-samd: Make the Arduino Zero build use a bootloader. 2016-10-14 13:10:16 -07:00
Scott Shawcroft 005b4505f5 Rework the READMEs to clarify that this is a MicroPython derivative and
not MicroPython proper.
2016-10-14 12:25:55 -07:00
Tony DiCola fffc6d1a17 atmel-samd: Add modules directory with frozen bytecode support (like ESP8266 port), and NeoPixel python wrapper module. 2016-10-14 11:39:42 +00:00
Tony DiCola 2ee52c4fde atmel-samd: Minor fixes to SysTick handler, enable all interrupts function. 2016-10-13 18:36:00 +00:00
Tony DiCola f77113c04f atmel-samd: Add time.ticks_diff function from esp port. 2016-10-13 05:18:18 +00:00
Tony DiCola 903bc8d04e atmel-samd: Implement time.ticks_ms function using SysTick timer, add global interrupt enable/disable functions. 2016-10-13 04:59:43 +00:00
Scott Shawcroft 011056af15 atmel-samd: Add support for SPI.
Also separate out the ASF config headers that are shared across all boards.
2016-10-11 15:48:43 -07:00
Scott Shawcroft 6986aa9aa2 atmel-samd: Change the FAT label so the board shows up as MICROPYTHON. 2016-10-10 12:17:11 -07:00
Scott Shawcroft 14f25337e7 atmel-samd: Fix FAT by giving the option of 4k sectors.
This causes the FATFS struct to have the ssize member because
sector size can be anywhere between 512 bytes and 4k bytes.
2016-10-10 12:16:02 -07:00
Scott Shawcroft a6254f4344 atmel-samd: Add basic support for experimental Metro M0 with an external flash chip. 2016-10-07 15:09:01 -07:00
Scott Shawcroft 5d6c4109e9 atmel-samd: Change USB Manufacturer from Adafruit to Adafruit Industries. 2016-10-07 15:06:42 -07:00
Scott Shawcroft 284d3414e1 atmel-samd: Make UART REPL Arduino Zero specific. Most will use USB REPL. 2016-10-07 15:06:07 -07:00
Scott Shawcroft 67372b369e atmel-samd: Fix A1 and A2 analog inputs.
Fixes #3.
2016-10-07 15:01:26 -07:00
Scott Shawcroft afedba5c2f atmel-samd: Support with statements for I2C class.
Also add init/deinit if you want to init/deinit manually.
2016-10-05 18:44:55 -07:00
Scott Shawcroft 42f6ba04a2 atmel-samd: Update the Micro Trace Buffer to have better defines.
Same as README.md here: https://github.com/adafruit/gdb-micro-trace-buffer
2016-10-05 18:42:02 -07:00
Scott Shawcroft 90bf13efd5 atmel-samd: Correct USB PIDs.
Arduino and Adafruit convention is for user programs to have PIDs
starting with 8 and bootloaders starting with 0.
2016-10-05 12:55:48 -07:00
Tony DiCola 9c67605233 atmel-samd: Add low level neopixel_write module & function for WS281x/neopixel RGB LEDs. 2016-10-05 12:35:23 -07:00
Scott Shawcroft 7e08347d5c atmel-samd: Support composite CDC and mass storage USB device.
Be careful to not use the flash file system while using mass storage
because both pieces of code attempting to change the fs can corrupt it.
2016-10-05 11:07:29 -07:00
Scott Shawcroft 1fa4c20c27 atmel-samd: Add Micro Trace Buffer support to the debug build.
The Micro Trace Buffer records the history of the pc and can be used
to debug hard faults even when the stack trace is useless.
2016-10-04 16:13:33 -07:00
Scott Shawcroft 98458c56cc atmel-samd: Remove debug flashes and comments. 2016-10-04 16:01:14 -07:00
Scott Shawcroft 0a10d17c28 atmel-samd: Update bossac_osx with one that works.
Add info to the README on how to get into bootloader on feathers. Fixes #6.
2016-10-03 12:57:06 -04:00
Scott Shawcroft ed34c35509 atmel-samd21: Support loading mpy files. 2016-09-26 15:43:52 -07:00
Scott Shawcroft b1be9f50ab atmel-samd: Remove module name from struct. 2016-09-26 15:02:16 -07:00
Scott Shawcroft eda33385e6 atmel-samd: Correct the stack_top pointer used in garbage collection.
Without this fix the gc will consider a large, random section of memory
and it may never finish.
2016-09-22 18:24:06 -07:00
Scott Shawcroft ffdc3f81df atmel-samd: Note a potential REPL ram savings. 2016-09-22 18:23:27 -07:00
Scott Shawcroft bbeed82378 atmel-samd: Run boot.py and main.py at startup and soft reboot. 2016-09-22 13:56:26 -07:00
Scott Shawcroft e56948650f atmel-samd: Enable mem_info display. 2016-09-22 13:16:13 -07:00