1
\$\begingroup\$

I'm working on a project in which I have to solve this problem. I'm not sure if it's unique, but it's certainly not one I've seen before so I thought it'd be interested to get some input from people smarter than myself!

The project has two systems, and the the requirements of each are...

System 1 (RTOS on STM32L4)

  • Must log data continuously (measurement at 10Hz)
  • Store a total of 100MB data per period (1 day)
  • Can only buffer data/be interrupted for ~5s at most
  • Must not lose any data

System 2 (Embedded Linux on i.MX8M Mini)

  • Must access and copy the most recent chunk of data at the end of each period
  • Copied data should be stored on removeable storage media
  • Must only be active for a short period of time to copy/analyse data

The parts have been selected to meet other requirements (peripherals, power, etc) and can't be changed. Common interfaces for both systems include SPI, SDIO, USB, I2C, and UART. The systems will be located <10cm from each other, but on two PCBs.

My current idea is to use two SD cards over SDIO, multiplexed to switch which SD card is accessed by which system (see diagram). SD cards are a nice option because they're easy to service and data can be checked manually. In principle this should work, but I am concerned I can't control the SDIO clock on the embedded Linux side, meaning implementation would be challenging or maybe impossible when it comes to layout.

enter image description here

Any input/discussion welcome!

\$\endgroup\$
3
  • \$\begingroup\$ What other interfaces between chips are common? USB? SPI? Ethernet? \$\endgroup\$
    – Justme
    Jan 7, 2022 at 14:16
  • \$\begingroup\$ I've updated the post, but; SPI, SDIO, USB, I2C, and UART. \$\endgroup\$
    – Sensors
    Jan 7, 2022 at 14:22
  • 3
    \$\begingroup\$ My advice would be to connect one of the ICs to both SD cards and use it as an interface. The other IC can request a write / read from the first one. Multiplexing it the way you’ve outlined can cause annoying race conditions that are hard to debug. Having one of the ICs work as a memory controller is akin to what we do in FPGAs with shared memories. If the two SD cards are on different boards, connect each one to its IC and then communicate between the ICs through SPI, I2C etc. It was not quite clear what is on which board from your post. \$\endgroup\$
    – user110971
    Jan 7, 2022 at 14:48

1 Answer 1

4
\$\begingroup\$

My advice would be to connect one of the ICs to both SD cards and use it as an interface. The other IC can request a write / read from the first one. If the two SD cards are on different boards, connect each one to its IC and then communicate between the ICs through SPI, I2C etc. It was not quite clear what is on which board from your post.

Multiplexing it the way you’ve outlined can cause annoying race conditions that are hard to debug. What’s even worse is that such issues can avoid detection during testing. Having the IC work as a memory controller is akin to what we do in FPGAs with shared memories.

\$\endgroup\$
2
  • \$\begingroup\$ I appreciate the feedback. Multiplexing indeed does seem like a pain! Perhaps I'm misunderstanding your suggestion, but do you mean use either the microcontroller or embedded linux procesor to connect to the storage device, and stream the data through one of them? Unfortunately for System 1 it's too busy reading and storing data to deal with also streaming the data out, and System 2 is too high powered to have on all the time and storing the data. \$\endgroup\$
    – Sensors
    Jan 7, 2022 at 15:46
  • 1
    \$\begingroup\$ @Sensors Yes, use one of the ICs as a memory controller. I mean you are logging 100 MB a day. How is the system too busy? Also, don’t you have peripherals on the STM? You have 3 SPIs and 6 UARTs from what I can gather. You haven’t mentioned anything about power requirements. \$\endgroup\$
    – user110971
    Jan 7, 2022 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.