This project will communicate through USB via the a terminal program like puTTY connected through a VCP created by USB OTG (On the Go).
The USB port is configured as a Client device using Full Speed (12MB/s). HS is not available as it would require a separate PHY.
I am implementing this with an STM32F446ZE.
This is project also utilizes CMSIS2 middleware implementation of FreeRTOS.
| Command | Input | Response |
|---|---|---|
| Read CO Value | READ $nodeid $index $sub-index | READ $nodeid $index> $sub-index $val $status $ticks> |
| Write CO Value | WRITE $nodeid $index $sub-index val | READ $nodeid $index> $sub-index $val $status $ticks> |
| Start CO Sync | SYNC START $time_ms | SYNC START $time_ms $status $ticks |
| STOP CO Sync | SYNC STOP | SYNC STOP $status $ticks |
| HELP | HELP | Print help text |
| RTC MENU | RTC | Real Time Clock Config Guide |
| BAUD | BAUD $rate_bits_per_s | BAUD $rate_bits_per_s $status $ticks |
| STATUS | STATUS | DONGLE $dongle_status CAN $can_status |
Chart doesn't show how NMT or SYNC will be handled but should show the asynchronour relationship between thhe input and output.
The queues listed here are standard FreeRTOS queues. I have not shown the WAIT/NOTIFY relationships between the processes.
READ REQUEST
- Processed, if request is malform send to response queue
- Generate SDO and send to mailbox 1
- If send to mailbox 1, if HAL returns error send to response queue
- If send to mailbox successful add request to wait queue
PROCESS WAIT
- check for timeout on items in queue, if item timed out send to response queue
PROCESS CAN RX
- Wait for response on RX Interrupt
- RX interrupt occurs, check if we're waiting for the response
- Check for error and timeout
- Send to response queue
