cancel
Showing results for 
Search instead for 
Did you mean: 

rt-thread project

Jan27
Associate II

I created project in stmcube32mx for h5 microcontroller and it works if I manually replace bl main to bl entry

in file startup_stm32h563zitx.s.

If this manual replacing is a bug or on purpose?

Jan

1 ACCEPTED SOLUTION

Accepted Solutions
KnarfB
Super User

This seems to be a very rt-thread specific topic and you might find specific help in their forum. 

hth

KnarfB

View solution in original post

10 REPLIES 10
KnarfB
Super User

Never heard of such a purpose. 

What does " it works" (or not) mean precisely? Linker errors? 

What version of STM32CubeMX and H5 firmware are you using?

Middlewares? 

Maybe you can post your .ioc file.

hth

KnarfB

 

Thank you for noticing my post.

After generating the project I noticed that in the file startup_stm32h563zitx.s (discovery board) still

there is bl main. I think it should be bl entry.

Program compiles in every situation but without changing to entry tasks don't run.

/* Call the application's entry point.*/

/* bl main */

bl entry

@Jan27  

Could you please provide the version of CubeMX and CubeIDE you are using?

I generated the project using your .ioc file with CubeMX version 6.16 and STM32CubeIDE version 1.19. I also tested it with bl main, and the execution runs without any issues.

Could you please specify the exact problem you encountered?

BR

Lobna

I created the simple task in main() :

/* USER CODE BEGIN 0 */
int counter;
struct rt_thread mythread1;
uint8_t mystack1[512];
static void thread_entry(void *parameter)
{
  while (1)
  {

    // Kod wykonywany przez wątek
    counter++;
    rt_thread_mdelay(1000); // Opóźnienie 1s
  }
}
/* USER CODE END 0 */

 

then I added :

/* USER CODE BEGIN 0 */
int counter;
struct rt_thread mythread1;
uint8_t mystack1[512];
static void thread_entry(void *parameter)
{
  while (1)
  {
    // Kod wykonywany przez wątek
    counter++;
    rt_thread_mdelay(1000); // Opóźnienie 1s
  }
}

/* USER CODE END 0 */

 

when in the file startup_stm32h563zitx.s there is :

bl main

the program goes into HardFault at rt_thread_startup(&mythread1);.

 

When in startup_stm32h563zitx.s there is

bl entry

mythread1 works counter counts.

 

Jan


Edited to apply source code formatting - please see How to insert source code for future reference.

Aha, I use stm32cubeide 2.0 and stm32cubemx 6.16.0

Jan

I founded the example project from Embetronicx on GitHub 

RT-Thread-RTOS/STM32F411/HelloWorld at master · Embetronicx/RT-Thread-RTOS · GitHub

and there also in the startup file there is 

/* Call the application's entry point.*/
bl entry

Jan

KnarfB
Super User

This seems to be a very rt-thread specific topic and you might find specific help in their forum. 

hth

KnarfB

Ok, it works for me now but I would expect that ST did something that it worked without manual adjusting

or clearly wrote what to do.

Jan

lobna
ST Employee

Dear @KnarfB @Jan27 

I will escalate this issue internally to enhance the ST documentation. Meanwhile, you may implement the recommended solution in the file Middlewares\Third_Party\RealThread_RTOS_RT-Thread\src\components.c when using the GCC compiler.
Specifically, at line 159:
/* Add -eentry to the arm-none-eabi-gcc linker arguments */

BR

Lobna