Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


Migration from Keil to AC6

Hi there!

I’m move my project form Keil uVision 5 to System Workbench but I have a proble with header file.

First, I use STM32CubeMx to generete the project for AC6.

I setup the microcontroller peripheral with STM32CubeMx and I added the FreeRTOS.
Next I generate the project selecting:

  • Toolchain SW4STM32
  • Copy all used library into the file project.


Second, I import my project into AC6: File -> Import -> General -> Existing project.

I can build the project without errors and I can start the debug.

Now I need to import a folder which contain my source code (task, peripheral libraries, ...).

I create a new source folder into the root of the project and I import the source and header files.

Import -> General -> File system -> My folder.

Three, I build the project and I obtain an error: ../Local/task/task_init.c:13:21: fatal error: service.h: No such file or directory.

Local is the source folder that I added and its contain my code.

With Keil I haven’t compilation errors.

I need to specify the header file into compiler options?

Any suggestions?

Thanks in advance!

France

Hi,
Just a few questions:

  1. When generating under CubeMX, do you keep “generate in root directory” checked?
  2. Where is located the service.h file you want to include?
  3. How is it included (with quotes or angle brackets)?
  4. When importing your source code, do you copy the files in your project or link to them?


Bernard (Ac6)

Hi Bernard,

thanks for the reply.

I unchecked the “generate in root directory”.

The service.h is located in a folder contained into another folder placed into the project root directory.

The header file is included with quotes #include “service.h”

I made a copy of my code into the project directory and then I imported it trought file menu -> import.

Where I’m wrong?

Thanks

France

Hi,

The problem is due to unchecking “generate in root directory”; in this case you usually get strange ‘File not found” errors for new files, as the structure you see under the process explorer is different from th estructure seen by the compiler...

So try with keeping this option checked, it should work in a more understandable way.

Bernard (Ac6)

Hi,

if i check “generate in root directory”, System workbench ac6 can’t start to build the project. If i click build nothing happens.

I solved the problem adding one folder at time into linker processor.

Thanks


Hi Bernard,

I need your help once again!

Now my problem regards the redirection of printf to UART2.

My MCU is a STM32F103VDT and I use UART2 to print debug on serial console.

On Keil I used this code to redirect the printf trough UART2:

int fputc(int ch, FILE *f)
{
/* Place your implementation of fputc here */
/* e.g. write a character to the USART */

if ((char)ch == ‘\n’) /* Add a LF before \n — LF -> CR LF */
{
HAL_UART_Transmit(&huart2,(uint8_t*)”\r”,1,1);
}

HAL_UART_Transmit(&huart2,(uint8_t*)&ch,1,1); // 1 tick waiting (1ms) enough for 87us/byte at 115200

return ch;
}



But now this code not works when I compile with System WorkBench AC6.

Exploring the forum I found a hint regarding the redirection of UART.

It’s suggest to use this code to redirect the printf (I add my code into the function):

void __io_putchar(uint8_t ch)
{
/* Place your implementation of fputc here */
/* e.g. write a character to the USART */

if ((char)ch == ‘\n’) /* Add a LF before \n — LF -> CR LF */
{
HAL_UART_Transmit(&huart2,(uint8_t*)”\r”,1,1);
}

HAL_UART_Transmit(&huart2,(uint8_t*)&ch,1,1); // 1 tick waiting (1ms) enough for 87us/byte at 115200

//return ch;
}


But this code not works.

Any suggestion?

Thanks


 

Newest Forum Posts

  1. reservation car service Seattle by Jamesprede, 2025-05-01 10:06
  2. Last day: drone bonus by Danielrug, 2025-04-19 16:55
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Insightful Perspectives on This Subject by davidsycle, 2025-03-04 05:45
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  10. Build a project in "release" mode by tang, 2025-02-20 10:36

Last-Modified Blogs