I totally missed the USB-CDC in testhal.. To answer your question, yes I can compile and run that code just fine which is what I was looking for..
I still get the linker with your Github project, the only differences I found in the Makefile's were
USE_FPU = no
the include $(CHIBIOS)/test/test.mk is not commented out
and in CSRC there is a ref to $(TESTSRC) \
none made a difference.
Thank you for pointing out the other project.
-John Gentilin
Example code for STM32F4 Discovery
Re: Example code for STM32F4 Discovery
I made a change to the "threads" command. I added the thread name to the display.
Now if you set the thread name it will show up correctly in the list.
Here is the updated function:
If you find any problems, please let me know.
-John
Now if you set the thread name it will show up correctly in the list.
Here is the updated function:
Code: Select all
void cmd_threads(BaseSequentialStream *chp, int argc, char *argv[])
{
static const char *states[] = {THD_STATE_NAMES};
Thread *tp;
(void)argv;
if (argc > 0)
{
chprintf(chp, "Usage: threads\r\n");
return;
}
chprintf(chp, "%10s %10s %10s %6s %6s %11s %7s\r\n",
"name", "add", "stack", "prio", "refs", "state", "time");
tp = chRegFirstThread();
do
{
chprintf(chp, "%10s %.10lx %.10lx %6lu %6lu %11s %7lu\r\n",
(uint32_t)tp->p_name, (uint32_t)tp, (uint32_t)tp->p_ctx.r13,
(uint32_t)tp->p_prio, (uint32_t)(tp->p_refs - 1),
states[tp->p_state], (uint32_t)tp->p_time);
tp = chRegNextThread(tp);
} while (tp != NULL);
}If you find any problems, please let me know.
-John
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Example code for STM32F4 Discovery
The thread name could be NULL if not set, you should consider that case.
Giovanni
Giovanni
Re: Example code for STM32F4 Discovery
In the updated "threads" command function, I tested for the case of Process Name p_name being null.
The displays "(Null)" in that column.
If anyone gets an error, please try to give me some details.
-John
The displays "(Null)" in that column.
If anyone gets an error, please try to give me some details.
-John
-
awilkinson
- Posts: 2
- Joined: Mon Sep 03, 2012 9:25 pm
Re: Example code for STM32F4 Discovery
Thanks for all your hardwork and generosity! I've had a couple of goes at compiling this using Yagarto on WinXP SP3 and Summon on Debian. In both cases I get:
../ChibiOS/os/hal/platforms/STM32F4xx/hal_lld.h:775:2: error: #error "Using a wrong mcuconf.h file, STM32F4xx_MCUCONF not def
../ChibiOS/os/hal/platforms/STM32/OTGv1/usb_lld.h:152:2: error: #error "USB driver activated but no USB peripheral assigned"
Please would you be kind enough to advise on what I'm doing wrong? I apologise for my ignorance and stupidity.
DDEFS = -DSTM32F4xx_MCUCONF -DSTM32_USB_USE_OTG1
in the Makefile got me a little further but then I got:
myUSB.c:152:3: error: extra brace group at end of initializer
myUSB.c:152:3: error: (near initialization for 'serusbcfg')
../ChibiOS/os/hal/platforms/STM32F4xx/hal_lld.h:775:2: error: #error "Using a wrong mcuconf.h file, STM32F4xx_MCUCONF not def
../ChibiOS/os/hal/platforms/STM32/OTGv1/usb_lld.h:152:2: error: #error "USB driver activated but no USB peripheral assigned"
Please would you be kind enough to advise on what I'm doing wrong? I apologise for my ignorance and stupidity.
DDEFS = -DSTM32F4xx_MCUCONF -DSTM32_USB_USE_OTG1
in the Makefile got me a little further but then I got:
myUSB.c:152:3: error: extra brace group at end of initializer
myUSB.c:152:3: error: (near initialization for 'serusbcfg')
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Example code for STM32F4 Discovery
Hi,
The newer version in the repository checks that the mcuconf.h file into the application directory is the right one for the selected architecture. Probably your mcuconf.h file is from an older version, you have to update it by taking one from one of the included demos for the STM32F4.
The second error is fixed by enabling the USB support in the mcuconf.h, previously it was enabled by default, now it is disabled.
Giovanni
The newer version in the repository checks that the mcuconf.h file into the application directory is the right one for the selected architecture. Probably your mcuconf.h file is from an older version, you have to update it by taking one from one of the included demos for the STM32F4.
The second error is fixed by enabling the USB support in the mcuconf.h, previously it was enabled by default, now it is disabled.
Giovanni
Re: Example code for STM32F4 Discovery
Giovanni wrote:The second error is fixed by enabling the USB support in the mcuconf.h, previously it was enabled by default, now it is disabled.
How or where the documentation is ?
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Example code for STM32F4 Discovery
Hi,
You request is a bit generic, the documentation is here: http://www.chibios.org/dokuwiki/doku.ph ... :documents
Giovanni
You request is a bit generic, the documentation is here: http://www.chibios.org/dokuwiki/doku.ph ... :documents
Giovanni
Re: Example code for STM32F4 Discovery
Hi,
I made a tiny rework of this project. Now it works on current unstable ChibiOS/RT 2.5.2. I also included a change in cmd_threads from this topic.
Git repository: https://github.com/resset/STM32F4-Discovery-example-code
Thanks for this project, Mathias
And (first and foremost!) thanks for ChibiOS, Giovanni
My first post here 
Mateusz
I made a tiny rework of this project. Now it works on current unstable ChibiOS/RT 2.5.2. I also included a change in cmd_threads from this topic.
Git repository: https://github.com/resset/STM32F4-Discovery-example-code
Thanks for this project, Mathias
And (first and foremost!) thanks for ChibiOS, Giovanni
Mateusz
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times