Memory and Signal Logging Limitations on SD Card

SD Card Logging Memory Limitation: SD Card logging allocates static memory for all the signal that is logged. The memory allocated is based on the type of logging i.e. Save Format, Sample Time, Model stop time, Decimation and Limit data points to last. Since the RAM size for Arduino boards such as Due, MKR1000, MKR WiFi 1010, and MKRZero is limited, there are chances of memory allocation failure when SD card logging is enabled. See Log Signals on an SD Card.

  • Data memory allocation failure when SD card logging is enabled

    Try the following steps, in case of data memory allocation failure:

    • Select lower value for Limit data points to last . Lower value can result in smaller static memory allocation

    • Set the logging type as Array instead of structure or structure with time.

    • Reduce the number of signals that can be logged in the model

    • Reduce the sample rate for logging either by using rate transition blocks or decimation parameter

  • Code memory allocation failure

    Code memory allocation fails when the SD Card feature and the algorithm together is generating code bigger than the allocated code memory.

    Try the following steps in case of code memory failure:

    • Reduce the size of the model there by reducing the code generated

SD Card Logging Connection Limitation: SD card logging uses SPI (Serial Peripheral Interface) to send the data between processor and memory. The data logging will be affected based on the SPI connections and SPI parameter settings.

If the signals are not logging on SD card, try the following steps:

  • Ensure proper SPI module is selected for SD card logging

  • If you are using the external SD card interface, ensure the connections for SPI pins are correct

  • Ensure correct supply and ground is connected for the external SD card interface

  • Start with lower baud rate for SPI. Change the SPI baud rate setting in Configuration parameters

See Also