7 years, 8 months ago.

Nucleo F303K8: ANY project fails to compile offline

The problem I am having is that any project for Nucleo F303K8 fails to build using offline GCC, even a default Blinky project would fail. I build offline to other Nucleo platforms (F401, F411, F466) and I have no problems.

I get the following errors: .././mbed/TARGET_NUCLEO_F303K8/stm32f303x8.h:761:29: error: expected identifier before '(' token

  1. define CAN ((CAN_TypeDef *) CAN_BASE) ^ .././mbed/CAN.h:67:7: note: in expansion of macro 'CAN' class CAN { ^ .././mbed/TARGET_NUCLEO_F303K8/stm32f303x8.h:761:43: error: expected ')' before '*' token
  2. define CAN ((CAN_TypeDef *) CAN_BASE) ^ .././mbed/CAN.h:67:7: note: in expansion of macro 'CAN' class CAN { ^ .././mbed/TARGET_NUCLEO_F303K8/stm32f303x8.h:761:43: error: expected ')' before '*' token
  3. define CAN ((CAN_TypeDef *) CAN_BASE) ^ .././mbed/CAN.h:67:7: note: in expansion of macro 'CAN' class CAN { ^ ../main.cpp:12:1: error: expected '}' at end of input } ^ make[1]: * [main.o] Error 1 make: * [all] Error 2

Can anybody help with this?

Thanks, Gabriel.

1 Answer

7 years, 8 months ago.

See some of the other questions like: https://developer.mbed.org/questions/70477/Latest-mbed-lib-causing-issues-with-Nucl/. They activated CAN, but they forgot to actually add the code to use it. Use an older revision until they fixed it.

Accepted Answer

Hello Erik,

Thanks for your answer. Digging a little bit more into the problem, I found out that the problem is not with the mbed libraries revision, as in the thread you pointed me to, but is on the way the offline Makefile for GCC Arm is generated. I conpared the Makefile I got today with a Makefile generated like a month ago, and is very different, I modified the new Makefile to be like the old one, using the latest mbed revision libraries and the project build.

posted by Gabriel Rivas 25 Jul 2016