1. 18 Apr, 2021 2 commits
  2. 16 Apr, 2021 1 commit
    • Tim Radvan's avatar
      rp2/rp2_pio: Add fifo_join support for PIO. · f842a40d
      Tim Radvan authored
      The PIO state machines on the RP2040 have 4 word deep TX and RX FIFOs.  If
      you only need one direction, you can "merge" them into either a single 8
      word deep TX or RX FIFO.
      
      We simply add constants to the PIO object, and set the appropriate bits in
      `shiftctrl`.
      
      Resolves #6854.
      Signed-off-by: default avatarTim Radvan <tim@tjvr.org>
      f842a40d
  3. 15 Apr, 2021 5 commits
  4. 14 Apr, 2021 5 commits
  5. 13 Apr, 2021 2 commits
  6. 12 Apr, 2021 6 commits
    • matejcik's avatar
      py/runtime: Make sys.modules preallocate to a configurable size. · 1a2ffda1
      matejcik authored
      This allows configuring the pre-allocated size of sys.modules dict, in
      order to prevent unwanted reallocations at run-time (3 sys-modules is
      really not quite enough for a larger project).
      1a2ffda1
    • matejcik's avatar
      py/profile: Resolve name collision with STATIC unset. · b26def06
      matejcik authored
      When building with STATIC undefined (e.g., -DSTATIC=), there are two
      instances of mp_type_code that collide at link time: in profile.c and in
      builtinevex.c.  This patch resolves the collision by renaming one of them.
      b26def06
    • Damien George's avatar
      stm32/rfcore: Intercept addr-resolution HCI cmd to work around BLE bug. · 2668337f
      Damien George authored
      The STM32WB has a problem when address resolution is enabled: under certain
      conditions the MCU can get into a state where it draws an additional 10mA
      or so and eventually ends up with a broken BLE RX path in the silicon.  A
      simple way to reproduce this is to enable address resolution (which is the
      default for NimBLE) and start the device advertising.  If there is enough
      BLE activity in the vicinity then the device will at some point enter the
      bad state and, if left long enough, will have permanent BLE RX damage.
      
      STMicroelectronics are aware of this issue.  The only known workaround at
      this stage is to not enable address resolution, which is implemented by
      this commit.
      
      Work done in collaboration with Jim Mussared aka @jimmo.
      Signed-off-by: default avatarDamien George <damien@micropython.org>
      2668337f
    • Damien George's avatar
      stm32/rfcore: Fix race condition with C2 accessing free buffer list. · dd62c52a
      Damien George authored
      Prior to this commit, if C2 was busy (eg lots of BLE activity) then it may
      not have had time to respond to the notification on the IPCC_CH_MM channel
      by the time additional memory was available to put on that buffer.  In such
      a case C1 would modify the free buffer list while C2 was potentially
      accessing it, and this would eventually lead to lost memory buffers (or a
      corrupt linked list).  If all buffers become lost then ACL packets
      (asynchronous events) can no longer be delivered from C2 to C1.
      
      This commit fixes this issue by waiting for C2 to indicate that it has
      finished using the free buffer list.
      
      Work done in collaboration with Jim Mussared aka @jimmo.
      Signed-off-by: default avatarDamien George <damien@micropython.org>
      dd62c52a
    • jahr's avatar
      rp2: Add support for building different board configurations. · 7ca68668
      jahr authored
      This change allows to build firmware for different rp2-based boards,
      following how it is done in other ports like stm32 and esp32.  So far only
      the original Pico and Adafruit Feather RP2040 are added.  Board names
      should match (sans case) those in pico-sdk/src/boards/include/boards/.
      
      Usage: Pico firmware can be build either using make as previously (it is
      the default board) or by `make BOARD=PICO`.  Feather is built by `make
      BOARD=ADAFRUIT_FEATHER_RP2040`.  Only the board name and flash drive size
      is set, pin definition is taken from the appropriate pico-sdk board
      definition.  Firmware is saved in the directory build-BOARD_NAME.
      7ca68668
    • robert-hh's avatar
      rp2/machine_uart: Add buffered transfer of data with rxbuf/txbuf kwargs. · 1be74b94
      robert-hh authored
      Instantiation and init now support the rxbuf and txbuf keywords for setting
      the buffer size.  The default size is 256 bytes.  The minimum and maximum
      sizes are 32 and 32766 respectively.
      
      uart.write() still includes checks for timeout, even if it is very unlikely
      to happen due to a) lack of flow control support and b) the minimal timeout
      values being longer than the time it needs to send a byte.
      1be74b94
  7. 11 Apr, 2021 1 commit
    • robert-hh's avatar
      rp2/rp2_pio: Add StateMachine restart,rx_fifo,tx_fifo helper functions. · 22554cf8
      robert-hh authored
      StateMachine.restart: Restarts the state machine
      StateMachine.rx_fifo: Return the number of RX FIFO items, 0 if empty
      StateMachine.tx_fifo: Return the number of TX FIFO items, 0 if empty
      
      restart() seems to be the most useful one, as it resets the state machine
      to the initial state without the need to re-initialise/re-create.  It also
      makes PIO code easier, because then stalling as an error state can be
      unlocked.
      
      rx_fifo() is also useful, for MP code to check for data and timeout if no
      data arrived.  Complex logic is easier handled in Python code than in PIO
      code.
      
      tx_fifo() can be useful to check states where data is not processed, and is
      mostly for symmetry.
      22554cf8
  8. 09 Apr, 2021 9 commits
  9. 08 Apr, 2021 1 commit
  10. 07 Apr, 2021 5 commits
  11. 06 Apr, 2021 3 commits