Skip to content

Conversation

@robert-hh1
Copy link

  • sdcard.py: Add SD card driver to the scripts directory
    SD cards require to use FAT. Thus it was enabled here.

  • polarity and phase were assigned wrongly and evaluated wrong

  • firstbit keyword was evaluated wrong

  • use the same default values for make_new and init.

  • No default assignment of the cs Pin
    This removes the default assignment of PB_15 to the cs pin.
    As a result, cs will not be pulled automatically. If that is
    wanted, assign cs in the SPI constructor or spi.init() call.
    Without the automatic cs assignment, the drivers for SD-Card and spi
    flash work with the hard SPI and not Pin has to be salvaged.
    The old code is kept as commented line.

  • Add write_readinto support to the SDK supporting the respective
    Python method. This required a change to wm_hostspi.c
    Since the original SDK should not be touched, I copied the required
    files into the Micropython branch, which is the second best option.

The driver for the SD card is part of this commit.
The driver for SPI-flash can be found here, subdir flash:
https://github.com/peterhinch/micropython_eeprom.git

e-tobi and others added 2 commits May 23, 2020 16:24
parenthesis-typo caused tls_reg_read() to hang on invalid register
- sdcard.py: Add SD card driver to the scripts directory
  SD cards require to use FAT. Thus it was enabled here.

- polarity and phase were assigned wrongly and evaluated wrong

- firstbit keyword was evaluated wrong

- use the same default values for make_new and init.

- No default assignment of the cs Pin
  This removes the default assignment of PB_15 to the cs pin.
  As a result, cs will not be pulled automatically. If that is
  wanted, assign cs in the SPI constructor or spi.init() call.
  Without the automatic cs assignment, the drivers for SD-Card and spi
  flash work with the hard SPI and not Pin has to be salvaged.
  The old code is kept as commented line.

- Add write_readinto support to the SDK supporting the respective
  Python method. This required a change to wm_hostspi.c
  Since the original SDK should not be touched, I copied the required
  files into the Micropython branch, which is the second best option.

The driver for the SD card is part of this commit.
The driver for SPI-flash can be found here, subdir flash:
    https://github.com/peterhinch/micropython_eeprom.git
@robert-hh1 robert-hh1 changed the title machine.spi: Bug fixes + SD-Card & SPI flash support machine_spi.c: Bug fixes + SD-Card & SPI flash support Jun 9, 2020
@robert-hh robert-hh mentioned this pull request Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants