Menu

#11 writing logs to a flash card

ToDo
closed
Kot_dnz
None
2014-02-06
2013-11-06
Andrey B
No

We need a feature of writing log files on an external SD card.

The build-in flash is probably too small, so we should use an external spi SD or SDIO module and write log files using fatfs FAT driver. I guess the logs should be TunerStudio compatible from the start.

Discussion

  • Andrey B

    Andrey B - 2013-11-06
    • Milestone: Phase 0 --> ToDo
     
  • Andrey B

    Andrey B - 2013-12-24

    You would need to download the full official 'chibios 2.6.1' distro and add the needed files for 'fatfs' support - that would be some files from 'etc/fatfs...zip' and some files from os/variaous/fatfs_bindings

    Then you would need to look at the existing fatfs examples and first step would be to create a new file called 'log.txt' and write 'hello world' string into this file :)

    Please note that there are TWO physical modes of SD card operation: SDIO which is newer and older SPI based MMC mode which is running on SPI. I believe SPI MMC is simpler and better for us - let's begin by using SPI based.

    We already have some SPI code. As a hint - start by running the slowest SPI possible (100-200-500Kb), it is the most reliable one if you are using noisy jumper wires.

     

    Last edit: Andrey B 2013-12-24
  • Andrey B

    Andrey B - 2013-12-24
    • assigned_to: Kot_dnz
     
  • Andrey B

    Andrey B - 2013-12-28

    We already have initSpiModules() method which already turns SPI on

    define EFI_SPI2_SCK_PORT GPIOB

    define EFI_SPI2_SCK_PIN 13

    define EFI_SPI2_MISO_PORT GPIOB

    define EFI_SPI2_MISO_PIN 14

    define EFI_SPI2_MOSI_PORT GPIOB

    define EFI_SPI2_MOSI_PIN 15

    We already have the Chip Select pin defined

    define SPI_SD_MODULE_PORT GPIOD

    define SPI_SD_MODULE_PIN 11

    outputPinRegister("spi CS5", SPI_CS_SD_MODULE, SPI_SD_MODULE_PORT, SPI_SD_MODULE_PIN);

    I have also added some 'mmc_card.c' skeleton

     
  • Andrey B

    Andrey B - 2014-02-06
    • status: open --> closed
     

Log in to post a comment.