New Member [Q] streamRead

Discussions and support about ChibiOS/RT, the free embedded RTOS.
robert_o
Posts: 48
Joined: Fri Feb 17, 2017 11:25 pm
Has thanked: 1 time
Been thanked: 5 times

New Member [Q] streamRead

Postby robert_o » Fri Feb 17, 2017 11:48 pm

Hello everybody.
I am quite new to RTOS and ARM so maybe i have some dumb questions, i am not totally new to C Programming though. I am working with ChibiStudio (Version: Luna Service Release 2 (4.4.2) Build id: 20150219-0600) with a DISCOVERY F4 (STM32F407VGT). I used the Example RT-STM32F407_DISCOVERY_MEMS and started from there. I am very impressed how easy working with Chibios is. The documentation is very good. I started some days ago and after a lot of struggle with installing an IDE (i tried four) and then figuring out the driver libs (CUBE with HAL and SPL) trying some alternative libs without success (libopencm3, tilen majerle) i stumbled over Chibios and everything just worked - i love it :).
Concerning my Project:
i am building an analyzer for Engine control units (actually it is the third version) i use the internal DAC to generate a waveform which imitates the trigger wheel. It looks like this: (http://forums.pelicanparts.com/uploads1 ... 366968.jpg).
This waveform is generated with Matlab as an array with 7200 8bit values (0.1 degree resolution and two crank revolutions). I want to transmit this array to the ARM over USB-CDC and should have it in a variable (an array) in RAM. Is this possible with streamRead?
I already used streamWrite (the example from: ChibiOS_16.1.7\community\testhal\STM32\STM32F4xx\USB_HOST) an writing works fine with "streamWrite(&SDU1, buf, sizeof buf-1);".
I just can't find any example for read.
A little help would be appreciated.
best regards
Robert

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: New Member [Q] streamRead

Postby Giovanni » Sat Feb 18, 2017 7:48 am

Hi,

Under /testhal/STM32 you will find an USB_CDC demo that emulates a serial port over USR, note that the demo implements a shell, you may implement a new shell command that loads your data.

Then look for the DAC them, it shows how to stream a data array to the DAC.

Put the two demos together and you will have most of your application.

Giovanni


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 3 guests