add UART on Blinky project

Hi,

I am new in Synegy S7G2 board.  I created a demo code using Blinky example, it run good and blink the 3 LEDs at 2Hz rate.

But if I add a new UART thread, enable the TX/RX/transmit end interrupt -> generate Project content, build the project, then the main.c no longer call the hal_entry.c routine, LED will not blink anymore. 

main.c just enter tx_kernel_enter ();

So where is the main routine going? 

 

Thanks!

 

  • Yes, that is correct. The hal_entry is no longer used once you add a thread to the project.
    Main does call tx_kernel_enter() which causes ThreadX to start to run. ThreadX calls tx_applicaion_define() which will call tx_application_define_user() if supplied. The tx_application_define() function call the thread creation functions that are generated by the Synergy Configurator. The system will never return from tx_kernel_enter().

    If you want to use threads + blinky, you should start with the Blinky with ThreadX project that uses a thread to blink the leds.
    If you don't want to use ThreadX you can delete your UART thread and add the Uart driver directly to the HAL/Common group.

    -Gary
  • In reply to garyj:

    Hi Gary,

    I see.
    Now I created another blinky using ThreadX, it has a blinky_thread_entry().
    But I am not able to add any debug break point inside any line of this routine.
    It is the same case when create new thread, no break point can be added to debug.

    Thanks!
    Martin
  • In reply to dynamictoys:

    Hi Martin,

     

    Does your application is running? Do you see LEDs blinking?

     

    First of all, please make sure you have "Skip All Breakpoints" option disabled (it's marked by red arrow on screenshot). When you debug the application, breakpoints can be set only at lines with an address e.g. you can set it at lines 16, 29, 32 or 34. Depending of compiler options, the compiler can optimize out some variables, instructions. If you debug your application, I recommend to set optimization level to -O0 or -Og using Project > Properties > C/C++ Build > Settings > Optimization > Optimization Level.

     

     

    Regards,
    adboc

  • In reply to dynamictoys:

    Martin,

    Is your project working?

    Mike Clements
    RenesasRulz Moderator
  • Hi..i am a new user here. As per my knowledge if you want to use threads + blinky, you should start with the Blinky with ThreadX project that uses a thread to blink the leds.If you don't want to use ThreadX you can delete your UART thread and add the Uart driver directly to the HAL/Common group.
  • In reply to RickyTerzis:

    Hello RickyTerzis,

    that is correct.

    BR,
    anper