element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
MaaXBoard Hardware Design MaaXBoard-RT: "DualSPIder" project overview - FYI
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 6 replies
  • Subscribers 322 subscribers
  • Views 833 views
  • Users 0 members are here
  • USB VCP
  • USB memory
  • network
  • Maaxboard RT
  • uart
  • SPI slave
  • tftp
  • DualSPIder
  • spi master
  • web server
Related

MaaXBoard-RT: "DualSPIder" project overview - FYI

tjaekel
tjaekel over 2 years ago

FYI,
what is my project, which building blocks (features) do I need...?

I need a network based SPI adapter. It is used for pre- and post-silicon verification (test chips, as "Device Under Test" (DUT)).
Python scripts running on a host PC, it should fire SPI transactions, perform test cases, drain and evaluate data (from external chip connected as DUT), send results to host.

What is "DualSPIder"?

Actually, I want to compensate "round trip delays" on SPI:
The SPI cable can be long, e.g. the DUT sits in an oven, heated up to 85C and more, but I do not want to place entire MCU board also into the oven ("just" to keep SPI cable short).
It would fail and MCU would be grilled on high temperatures, MCU would be dead before my DUT.

SPI is "synchronous": the sampling clock is provided (and used as reference for Rx) by the MCU:
Any longer cable results in bit errors because the Rx signal (MISO) comes now too late (MISO is delayed but not SCLK: MCU internal).

Therefore, 'if possible':
Have one unidirectional SPI Tx (as master). feed back the SCLK signal from far end (DUT) and use a second SPI Rx (also unidirectional) to sample responses (as slave).
So, one Tx SPI (master), one Rx SPI (slave), and the SCLK signal is delayed ("reflected") in the same way as MISO due to the cable length.

What do I need (building blocks)?

Two SPI interfaces - master + slave:
One SPI Tx (master), if possible also a second SPI as Rx (slave) = "DualSPIder"
(not sure: Teensy 4.1 was not able to do).

Network (ETH):
used for:

  • MCU internal web browser (user can fire commands from a web page interface, no driver/SW installation)
  • Python network access: a Python script on host can fire commands (via TCP/IP) and get results (also Matlab as host script engine)
  • UDP unidirectional data: when data is drained - send it to the host
  • TFTP: I need test scripts loaded and executed on MCU: transfer files to external storage (here it will be USB memory device, SD card not available)

FreeRTOS:
I will have several tasks (threads), e.g. GPIO INT(s), TFTP, ETH (web browser plus host scripts), UART command line.
RTOS is a "must" to have, to organize tasks and give them a priority (e.g. GPIO INT is highest, because "real time" actions to do).

External Memory:
Test scripts ("Pico-C", see following), have to be transferred and stored on SD card not available here, so USB memory stick.
So, USB MSC device, USB memory stick on user USB host port, with FatFS, is needed.

Script Engine:
I want to go with "Pico-C", a C-code interpreter, interactive, interpreted, in order to extend the system (without to recompile and flash entire FW).
My users should be able to program 'what a GPIO INT handler should do' (e.g. drain data via SPI, decode data, send results to host...).

I know, there is MicroPython, Lura ... but I want to go with a "C-code language". Why?
My users write test code in UVM (Universal Verification Modelling), SystemVerilog (which is like C++). I want to reuse test scripts, configuration scripts ... which look like C/C++ code.
So, "PIco-C" seems to be the best option, because same language as used by my users, easy to extend "Pico-C" by UVM/System Verilog "code" (functions needed) - I did already.

This "Pico-C" needs a permanent script storage (here it will be USB memory stick, with TFTP support to transfer files to/from it). And pretty large space needed (test cases, config files...).
Also the need for available code space (flash memory/ITCM) to consider just for the "Pico-C" code (and data).

GPIO Interrupts:
External GPIO interrupts have to be fast as possible ("real-time"). If one happens, all the actions to do - and it should be programmable "what to do" ("Pico-C"),
must happen in "real-time" (as fast as possible).

Also, the ETH network transfer, e.g. via UDP send the results of a processed GPIO INT handler, has to be fast (high network throughput).
Therefore, the 1Gpbs ETH port should be used (plus FreeeRTOS task to send).
A speed limitation here would conflict with the DUT performance: if every 1ms (1KHz) a huge packet of data (assume 2KB) has to be drained from DUT - it should be sent to host PC without a loss of network packets
(using UART, even it would be a faster USB VCP UART - is out of scope here).

UART and network in parallel:
The main access will be via network (a host Python script, via TCP/IP plus UDP for data).
But the board (FW) has to provide a backdoor, via UART (as USB-C VCP UART). It is used for debug test cases, to intervene from a user, to do all manually, to try something manually...

Flash for SYSCFG:
I want to have system config parameters in non-volatile storage (flash), e.g. for SPI clock speed, IP address of MCU.
Read SPI flash SYSCFG on startup, update/write via command line...

What will not be used?
I will not make use of (and potentially not getting familiar with):

  • PDM MICs on board (maybe for a leisure time project)
  • the DCIM camera interface and SW stack (maybe for a leisure time project - working on an "airplane tracker" via MIC and Camera...)
  • WiFi: too slow, not "allowed" in labs, too complicated to connect to a company network
  • BT: no need for it
  • AI, ML...: I would like to use TensorFlow, AI, ML... but no idea yet for what (what to automate/improve with it when it comes to testing DUT as external chips, based on their spec. and HW features to verify)

So, my next steps on MaaXBoard-RT:

  • bring-up ETH: network, web server inside MCU, TCP/IP command access (from host Python), UDP for data to host
  • bring-up USB Memory Host (for an USB stick), add TFTP to transfer from/to it
  • "DualSPIder": SPI Tx plus SPI Rx - I have to see: based on Teensy 4.1: SPI Rx is not fast enough on MCU (I need 40 Mbps) - potentially the same issue
  • "Pico-C": the needed code space, data space, USB memory as script storage
  • GPIO INT(s) (in combination with FreeRTOS, as tasks/threads handlers)
  • User GPIO: as input/output, on/from DUT

I try to keep you posted and to provide project files (via GitHub).
Maybe pieces/.experiences of/with my project might help you as well.

  • Sign in to reply
  • Cancel

Top Replies

  • tjaekel
    tjaekel over 2 years ago in reply to tjaekel +1
    next project works: tjaekel/MaaXBoard-RT_lwip_httpsrv_freertos_cm7: MaaxBoard RT HTTP server with FreeRTOS (github.com) the HTTP Server demo, with FreeRTOS, but 100M PHY and connector (1G needs modification…
  • tjaekel
    tjaekel over 2 years ago

    Update:

    what works so far (on reference projects):

    USB VCP UART:

    tjaekel/MaaXBoard-RT_cdc_vcom_freertos_cm7: MaaXBoard-RT VCP UART example (github.com

    USB Memory Device:

    tjaekel/MaaXBoard-RT_host_msd_fatfs_freertos_cm7: MaaXBoard RT with USB memory stick (github.com)

    LEDs (and debug UART):

    tjaekel/MaaXBoard-RT_shell_cm7: MaaXBoard-RT Shell with command to toggle LEDs (all three) (github.com)

    FreeRTOS:

    These projects use already FreeRTOS - fine.

    So, just "merge" the code into "my project".
    TODO;

    • ETH (network, TCP/IP, UDP) - maybe from the AVNET "out-of-the-box" demo, where it works)
    • SPI master device (and slave: if possible)
    • GPIO INT(s), with RTOS
    • "Pico-C", scripts... just at the end: "just" and issue with memory allocations (external memories, linker script...)
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • tjaekel
    tjaekel over 2 years ago in reply to tjaekel

    next project works:

    tjaekel/MaaXBoard-RT_lwip_httpsrv_freertos_cm7: MaaxBoard RT HTTP server with FreeRTOS (github.com)
    the HTTP Server demo, with FreeRTOS, but 100M PHY and connector (1G needs modification in project)

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • tjaekel
    tjaekel over 2 years ago in reply to tjaekel

    next project works:

    LPSPI4 as SPI Master:

    tjaekel/MaaXBoard-RT_lpspi_edma_b2b_transfer_master_cm7: MaaXBoard-RT LPSPI4 demo (github.com)
    the LPSPI4 on J1 header plus a GPIO INT (using User Button).

    So, it looks like, I have all together, for each building block a demo project working.
    "Just" merge all into one (new) project, using all the features.

    HW-wise, all working (what is needed).
    Just tweak later the "memory layout", e.g. to used SDRAM, FLASH, ITCM etc. for a huge project
    (esp. with "Pico-C" and scripts).

    Minor issue left:
    have SYSCFG as non-volatile on flash memory

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • tjaekel
    tjaekel over 2 years ago

    I have started on my final project:

    tjaekel/MaaXBoard-RT_SPIder: MaaXBoard-RT SPIder framework (github.com)

    I have started to merge several different SDK Examples into my project, to modify the code, add the glue logic etc.

    What works so far:

    • USB VCP UART:
      USB-C port: with command line via UART, see "help" for all the commands implemented
    • Debug UART:
      the UART as LPUART1, via MCU-LINK, is used for some logs, e.g. when you plug in a USB Memory stick
    • FreeRTOS:
      project uses FreeRTOS and runs (for now) on CM7 core (only)
    • USB Memory stick:
      connect an USB memory stick (formatted as FAT32) on User USB port (the USB-A port)
      see commands "umdir" and "umprint" working
    • LPSPI, as SPI device on header:
      test with cable between J1 pin 19 and pin 21, or connect a SPI slave device,
      fire SPI transactions from command line, via "rawspi"

    Watch my progress:

    You can watch my updates on GitHub:

    tjaekel/MaaXBoard-RT_SPIder: MaaXBoard-RT SPIder framework (github.com)

    I might pause here to add comments.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • tjaekel
    tjaekel over 2 years ago

    Both ETH PHYs are working now. Connect with two Web Browsers, on each PHY (see the different IP addresses, assigned by DHCP).
    You can use also "mDNS" and use names (instead of IP address): "maaxboard" vs. "maaxboardg"

    GitHub - tjaekel/MaaXBoard-RT_SPIder: MaaXBoard-RT SPIder framework

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • tjaekel
    tjaekel over 2 years ago in reply to tjaekel

    TFTP is working:
    transfer files via network and TFTP to/from USB memory stick

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube