Only the board.json files are affected. No other file uses the
style "Sparkfun". The documentation is fine.
Signed-off-by: robert-hh <robert@hammelrath.com>
The vendor and product fields in the `board.json` files were somewhat
inconsistent. Remove any duplication of the vendor name in the product
field so that `f"{vendor} {product}"` reads well.
In addition to that, update most of the URL's for `board.json` files that
are modified here, and match case and spacing used by the manufacturers for
the vendor and product names.
Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
Add support for the boards:
- SparkFun SAMD21 Dev Breakout
- SparkFun RedBoard Turbo
Both boards are SAMD21 based and actively sold by SparkFun.
Signed-off-by: robert-hh <robert@hammelrath.com>
Previously MicroPython ports would linker-wrap dcd_event_handler
in order to schedule the USB task callback to run when needed.
TinyUSB 0.16 added proper support for an event hook to do the
same thing without the hacky linker wrapping.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit renames the NORETURN macro, indicating to the compiler
that a function does not return, into MP_NORETURN to maintain the same
naming convention of other similar macros.
To maintain compaitiblity with existing code NORETURN is aliased to
MP_NORETURN, but it is also deprecated for MicroPython v2.
This changeset was created using a similar process to
decf8e6a8b ("all: Remove the "STATIC"
macro and just use "static" instead."), with no documentation or python
scripts to change to reflect the new macro name.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Since all QSPI flash device used by this port are defined, this code was
only used unintentionally. Besides that it was incomplete, so better drop
it.
Note: The flash type for Mini-SAM had to be changed too.
Signed-off-by: robert-hh <robert@hammelrath.com>
Changes in this commit:
- Check for the proper SFDP header.
- Use the flash size information from SFDP, if present.
- Add two more special flash chips <= 1 MByte without SFDP. JEDEC-ID table
for special flash types instead of a series of conditional statements.
- Add a compile flag `MICROPY_HW_SPIFLASH_SIZE` to set the size in
`mpconfigboard.h`, which replaces getting the size from the JEDEC ID or
the SFDP record.
Signed-off-by: robert-hh <robert@hammelrath.com>
Fixes in this commit:
- The wrong loader script was assigned for SAMD_GENERIC_D51X20, causing the
VFS block count to be wrong.
- Change the VFS block size from 1536 to 2048. With the setting of 1536,
writing more that 1536 bytes at once failed. This applies to
SAMD_GENERIC_D51X19 and SAMD_GENERIC_D51X20. No other SAMD51 board uses
the internal flash for the file system.
Signed-off-by: robert-hh <robert@hammelrath.com>
That is done by adding the offset to epoch, following the scheme from the
RP2 port. RTC and `ticks_us()` are not precisely in sync, and so the
difference between `time.time_ns()/1e9` and `time.time()` will increase by
more than 9 seconds/24h. So applications should avoid using `time.time()`
and `time.time_ns()` in the same context.
Signed-off-by: robert-hh <robert@hammelrath.com>
This is a follow-up to 1e92bdd206 correcting
more of the instances where "Sparkfun" should be "SparkFun".
Signed-off-by: Damien George <damien@micropython.org>
The buffer was be reset on every call to uart.init(). If no sizes were
given, the buffer was set to the default size 256. That made problems
e.g. with PPP.
This commit fixes it, keeping the buffer size if not deliberately changed
and allocating new buffers only if the size was changed. Cater for changes
of the bits value, which requires a change to the buffer size.
Signed-off-by: robert-hh <robert@hammelrath.com>
In combination with the defautl Pins the default device can now be
instantiated e.g. as: uart = UART(). Similar for I2C and SPI.
Signed-off-by: robert-hh <robert@hammelrath.com>
If a board configures a default UART instance and/or TX/RX pins then the
user can create a default UART object using `machine.UART()`.
Signed-off-by: robert-hh <robert@hammelrath.com>
If a board configures a default SPI instance and/or SCK/MOSI/MISO pins,
then the user can create a default SPI object using `machine.SPI()`.
Also, if MISO is not going to be used, then MISO can be set to `None` with
`miso=None`.
Signed-off-by: robert-hh <robert@hammelrath.com>
If a board configures a default I2C instance and/or SCL/SDA pins, then
these no longer need to be given in the constructor. This allows the user
to easily construct the default I2C instance via `machine.I2C()` and that
will work on the default pins as designated on the board silkscreen.
Signed-off-by: robert-hh <robert@hammelrath.com>
This commit upgrades from codespell==2.2.6 to the current codespell==2.4.1,
adding emac to the ignore-words-list.
Signed-off-by: Christian Clauss <cclauss@me.com>
Supporting a variant with an optional SPIFLASH device as well. Tested both
variants with a QT Py board.
Signed-off-by: robert-hh <robert@hammelrath.com>
The definition uses the internal oscillator for clock and only internal
flash for the file system.
It works at SAMD51J20 device as well, only that fewer pins are accessible.
Tested with a SAMD51J20 board.
Signed-off-by: robert-hh <robert@hammelrath.com>
The definition uses the internal oscillator for clock and only internal
flash for the file system.
It works at SAMD51G19 and SAMD51J19 devices as well, only that fewer pins
are accessible.
Tested with a SAMD51G19 and SAMD51J9 board.
Signed-off-by: robert-hh <robert@hammelrath.com>
The definition uses the internal oscillator for clock and only internal
flash for the file system.
It works at SAMD21G18 and SAMD21E18 devices as well, only that fewer pins
are accessible.
Tested with a SAMD21E18, SAM21G18 and SAMD21J18 board.
Signed-off-by: robert-hh <robert@hammelrath.com>
The QSPI baud is derived from the AHB clock, not from the APB (peripheral)
clock.
Datasheet: The QSPI Baud rate clock is generated by dividing the module
clock (CLK_QSPI_AHB) by a value between 1 and 255.
As previously implemented, all baudrates are 2.5 times greater than
expected.
Signed-off-by: I. Tomita <ziceva@me.com>
Improvements to DAC support for SAMD51:
- properly validate DAC id
- correctly use dac_init flag, as a 2-ple for A0, A1 channels
- disable DAC before adjusting settings, see SAMD5x data sheet §47.6.2.3
Co-authored-by: robert-hh <robert@hammelrath.com>
Signed-off-by: Graeme Winter <graeme.winter@gmail.com>
This commit makes the argument ordering of `machine.RTC.init()` the same
for all the ports that implement arguments to this method: cc3200, esp32,
mimxrt and samd. The cc3200 argument ordering is used, which matches the
documentation.
Also document the availability and the differing semantics for the stm32
and renesas-ra port.
Signed-off-by: robert-hh <robert@hammelrath.com>
Use `self` (the first argument) instead of the global `samd_flash_obj` when
accessing the `flash_base` parameter. This allows there to be multiple
flash objects for various types of filesystem.
Signed-off-by: robert-hh <robert@hammelrath.com>
The initial settings did not support it. The change required to add a
dedicated handling of the Adesto 1MByte flash of the XPLAINED PRO board,
which does not support the sfdp feature.
Fixes the ID check of the Adesto/Renesas 1MByte flash.
Signed-off-by: robert-hh <robert@hammelrath.com>
A bootloader labelled for the SAMD21 XPLAINED PRO board. The only
difference to a generic bootloader are the names and ID of the USB port and
the label of the drive that is opened.
Signed-off-by: robert-hh <robert@hammelrath.com>
Add instructions to install a bootloader to the board. The SAMD21 XPLAINED
PRO board is shipped without a bootloader, which therefore has to be
installed once before it can be used with MicroPython.
Signed-off-by: robert-hh <robert@hammelrath.com>
Prior to this commit, 9-bit UART data could be specified in the constructor
and was transmitted, but the 9th bit was set to 0 when sending, and ignored
when receiving. This commit completes 9-bit support in that the 9th bit is
taken from the data.
9-bit data has to be provided with `uart.write()` and and read with
`uart.read()` as two bytes for each transmitted item, low order byte first.
The data length supplied with `uart.write()` and requested by `uart.read()`
has to be even, which is checked. The size of the UART buffers will be
transparently doubled to cater for 9-bit data.
Signed-off-by: robert-hh <robert@hammelrath.com>
The following ports used 65536 as the upper value (100% duty cycle) and are
changed in this commit to use 65535: esp8266, mimxrt, nrf, samd.
Tested that output is high at `duty_u16(65535)` and low at `duty_u16(0)`.
Also verified that at `duty_u16(32768)` the high and low pulse have the
same length.
Partially reverts #10850, commits 9c7ad68165
and 2ac643c15b.
Signed-off-by: robert-hh <robert@hammelrath.com>
Set the UF2 firmware images family to Microchip SAMD21 or SAMD51. This
helps tools such as file to identify built firmware.
Signed-off-by: Alexandre Iooss <erdnaxe@crans.org>
Do NOT use `mp_hal_delay_us()` for short delays. This was initially done
to make short delays precise, but it does not allow for scheduling. Leave
using `mp_hal_delay_us()` to user code if needed.
Signed-off-by: robert-hh <robert@hammelrath.com>
The upper 32 bit of the 64 bit ticks register was taken before disabling
the interrupts. That may have caused a wrong return values. Besides that,
the function may cause trouble when called in an IRQ context, because it
unconditionally enables IRQ.
Signed-off-by: robert-hh <robert@hammelrath.com>
With the softtimer the minimal delay between the end of a message and the
trigger is 2 ms. For baud rates <= 9600 baud it's three character times.
Tested with baud rates up tp 115200 baud. The timer used for RXIDLE is
running only during UART receive, saving execution cycles when the timer is
not needed.
The irq.flags() value is changed only with an expected event. Do not
change it otherwise.
Signed-off-by: robert-hh <robert@hammelrath.com>
Supported for all SAMD51 devices and SAMD21 with external flash. For
interrupt events, IRQ_RX and IRQ_TXIDLE are provided.
IRQ_RX is called for every received byte. This may not be useful for high
data rates, but can be used to build a wrapper class providing an
IRQ_RXIDLE event or to signal just the first byte of a message.
IRQ_TXIDLE is called only when messages are longer than 5 bytes and
triggers when still 5 bytes are due to be sent.
The SAMD hardware does not support implementing IRQ_RXIDLE.
Signed-off-by: robert-hh <robert@hammelrath.com>
Currently for samd21 some features are disable because of limited memory.
With the ability to trade firmware and filesystem space, a user may wish to
selectively enable some of these features. This change allows them to be
enabled in board `mpconfigboard.h` or on the build command line for
example. The selectively enable functions are: MICROPY_PY_FRAMEBUF,
MICROPY_PY_SELECT, MICROPY_PY_ONEWIRE and MICROPY_PY_ASYNCIO.
Signed-off-by: Rick Sorensen <rick.sorensen@gmail.com>
There are a few TinyUSB CDC functions used for stdio that are currently
replicated across a number of ports. Not surprisingly in a couple of cases
these have started to diverge slightly, with additional features added to
one of them.
This commit consolidates a couple of key shared functions used directly by
TinyUSB based ports, and makes those functions available to all.
Signed-off-by: Andrew Leech <andrew@alelec.net>
Change provided by @ironss-iotec.
Tested with Adafruit, SEEED and MiniFig boards for non-interference.
Fixes issue #14190.
Signed-off-by: robert-hh <robert@hammelrath.com>
Using a define for MICROPY_HW_SPIFLASH_BAUDRATE in mpconfigboard.h. If not
defined the default is 24MHz.
Signed-off-by: robert-hh <robert@hammelrath.com>