error occur after define SDK_DEBUGCONSOLE=DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN

cancel
Showing results for 
Search instead for 
Did you mean: 

error occur after define SDK_DEBUGCONSOLE=DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN

290 Views
iysheng
Contributor I

After I port tencent OS to a board based on evkmimxrt1060. I can run ``evkmimxrt1060`` sdk with semc/sdram driver_example use default PRINTF function under linux with GNU tools.And I made the semc test code under a thread like:

``` C

/*!
* @brief Main function
*/
void sdram_task_entry(void *arg)
{
PRINTF("\r\n SEMC SDRAM Example Start! \r\n");

if (BOARD_InitSEMC() != kStatus_Success)
{
PRINTF("\r\n SEMC SDRAM Init Failed\r\n");
}
PRINTF("\r\n SEMC SDRAM Example Continue!\r\n");
/*
* 测试不同数据宽度的读写功能, 不支持 32 bit
* */
/* 32Bit data read and write. */
SEMC_SDRAMReadWrite32Bit();
/* 16Bit data read and write. */
SEMC_SDRAMReadWrite16Bit();
/* 8Bit data read and write. */
SEMC_SDRAMReadWrite8Bit();

PRINTF("\r\n SEMC SDRAM Example End.\r\n");
while (1)
{
PRINTF("sdram is running. pyocd is ok.\r\n");
tos_sleep_ms(1000);
}
}

```

But after I define macro with ``SDK_DEBUGCONSOLE=DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN`` and ``SDK_DEBUGCONSOLE_UART`` something surprising happened.

1. It will get stuck in the sdram test thread. After I use a led pin to debug, It stuck in this function ``BOARD_InitSEMC``. So after I comment these code like:

``` C

void sdram_task_entry(void *arg)
{

PRINTF("\r\n SEMC SDRAM Example Start! \r\n");

#if 0

if (BOARD_InitSEMC() != kStatus_Success)
{
PRINTF("\r\n SEMC SDRAM Init Failed\r\n");
}

#endif
PRINTF("\r\n SEMC SDRAM Example Continue!\r\n");

```

the code can run continue like:

2022-01-28_09-40.png

2. if I do not comment function ``BOARD_InitSEMC``, but i modify sth like:

void sdram_task_entry(void *arg)
{
PRINTF("\r\n SEMC SDRAM Example Start!  %d\r\n", 123);

if (BOARD_InitSEMC() != kStatus_Success)
{
PRINTF("\r\n SEMC SDRAM Init Failed\r\n");
}
PRINTF("\r\n SEMC SDRAM Example Continue!\r\n");
/*
* 测试不同数据宽度的读写功能, 不支持 32 bit
* */
/* 32Bit data read and write. */
SEMC_SDRAMReadWrite32Bit();
/* 16Bit data read and write. */
SEMC_SDRAMReadWrite16Bit();
/* 8Bit data read and write. */
SEMC_SDRAMReadWrite8Bit();

PRINTF("\r\n SEMC SDRAM Example End.\r\n");
while (1)
{
PRINTF("sdram is running. pyocd is ok.\r\n");
tos_sleep_ms(1000);
}
}

```

I till can run success just as:

2022-01-28_09-43.png

how could this happen?

Labels (1)
0 Kudos
5 Replies

282 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
According to your statement, it seems a bit weird.
The below code can run well even without initializing the SEMC。
In my opinion, I was wondering if you can introduce your testing environment and steps in detail, I hope this information can help me to figure the phenomenon out.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

279 Views
iysheng
Contributor I

Sure I use a the board here:https://github.com/OpenAtomFoundation/TencentOS-tiny/blob/master/doc/30.TencentOS_Tiny_EVB_AIoT_Quic...

My cross compiler is

2022-01-28_14-48.png

And the build enviroment is GN and Ninja by my own. The cdc.c and sdram test code as below in attach. Thanks for your patient replay.☺️

 

Tags (1)
0 Kudos

274 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi,
Thanks for your reply.
It seems like you integrate the DCD in the final bootable image, if that, the SDRAM will be initialized prior to ROM jumping to the application and it can explain the above SDRAM testing results.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos

272 Views
iysheng
Contributor I

yeah, but when I reinitialize sdram module in semc_sdram.c file and add printf("%d", 123); replace printf("123"), I still can print these messages of 123.

This is the more strange behavior.

0 Kudos

241 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi,
Thanks for your reply.
I'd like to know what option of SDK_DEBUGCONSOLE you configured that previous testing result.
Furthermore, do the previous strings also output via the UART pins?
Last, I'd like to suggest you refer to 16.5 Use of printf section in the MCUXpresso IDE User Guide to learn the printf usage.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos