2015-03-03 04:13 PM
Hello,
I am porting the Custom HID demo project that is included with STM32_USB-FS-Device_Lib_V4.0.0 library to work with my gcc-based toolchain. I have previously successfully ported other code (specifically, from Olimex for the EW-ARM 5.11 toolchain) to work with my toolchain with little difficulty. Both the new code and the previously ported code uses the __IO directive in places, and the library routines such as stm32f10x_adc.c also use it and were properly compiled and built in the previously ported code. However, the new code throws a large number of errors when it tries to compile usb_pwr.c. The first such error is: In file included from ./inc/usb_lib.h:37:0, from src/usb_pwr.c:31: ./inc/usb_regs.h:617:1: error: unknown type name '__IO' ./inc/usb_regs.h:617:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'wIstr' In file included from ./inc/usb_lib.h:39:0, from src/usb_pwr.c:31: I can make these and a large number of my subsequent errors go away by putting #define __IO volatile in usb_pwr.c. However, this makes that function non-standard which I don't want to do. After much searching I found that an identical definition is provided in the CMSIS/Include directory in core_cm0.h. Where and how is this header normally included in the demo code? Or is it included in the toolchain configuration? It must be included somewhere to compile the demo. I would like to duplicate that inclusion in my port or toolchain without modifying the distributed STM32_USB-FS-Device_Lib_V4.0.0 because that might give me major issues when that distribution is upgraded. Any help would be appreciated. Best regards, Peter2015-03-03 04:50 PM
On F4 parts, stm32f4xx.h #include's ''core_cm4.h''
On F1 parts, stm32f1xx.h #include's ''core_cm3.h''2015-03-03 06:18 PM
Thanks, clive1. Most helpful.
Best regards, Peter2016-11-06 11:26 PM
error: unknown type name '__IO'
What does it means accordance with header file?Afterwords, if you get , warning: control reaches end of non-void function [-Wreturn-type]This time would you mean,functions are returning without providing a value when one is expected.?
Kindly answer please.RegardsHasan2016-11-07 12:39 AM
The first suggests one or more include file is not being pulled, perhaps due to the absence of a define or other selective compilation.
The second suggests an int foo() function has multiple exit paths and one of those doesn't return an int.2016-11-07 01:03 AM
#ifdef USE_FULL_ASSERT
void assert_failed(uint8_t* file, uint32_t line)
{
*/
/* USER CODE END 6 */
}
#endif
Most funny thing is, all errors come from header files, even I include by # in main.c!I want to ask you , if I removed some folder ( previous project) which has similar include files that already exists in project properties path in C, would I face any problem?
RegardsHasan