apache / nuttx

Apache NuttX is a mature, real-time embedded operating system (RTOS)
https://nuttx.apache.org/
Apache License 2.0
2.85k stars 1.17k forks source link

MIMXRT1170-EVK board (not EVKB) can't enter nShell on 12.4 #11935

Open JamesZhou2023 opened 7 months ago

JamesZhou2023 commented 7 months ago

The codebase I used is Nuttx 12.4. HW is MIMXRT1170-EVK board (not EVKB). The configure command is "./tools/configure.sh -l imxrt1170-evk:nsh".

But I can't find any content on my serial terminal.

PetervdPerk-NXP commented 7 months ago

Could you check the dip switches on your EVK for the boot method?

Furthermore could you enable CONFIG_DEBUG_FEATURES this should yield more output.

JamesZhou2023 commented 7 months ago

@PetervdPerk-NXP Thanks for your quickly reply.

I already do some test.

  1. If Do not select "System Type -> Use D-Cache ", then it can enter NSH.
  2. If select "Use D-Cache" and "Memory Manager Warning Output", then it can enter NSH.

Reproduce this issue:

  1. select "Use D-Cache"
  2. Do not select "Memory Manager Warning Output" then it can not enter NSH.
PetervdPerk-NXP commented 7 months ago

Thanks for figuring out a working sequence. Could you share the log output of a booting IMXRT1170-EVK?

JamesZhou2023 commented 7 months ago

Bnx_start: Entry nx_start: nxsem_initialize mm_initialize: Heap: name=Umem, start=0x20241948 size=779960 mm_addregion: [Umem] Region 1: base=0x20241aac size=779600 nx_start: g_npidhash == 4 mm_malloc: Allocated 0x20241ac0, size 24 nx_start: g_npidhash == 4 ----1 mm_malloc: Allocated 0x20241ad8, size 120 mm_malloc: Allocated 0x20241b50, size 24 m

JamesZhou2023 commented 7 months ago

I add some log in nx_start.c

/ Initialize the logic that determine unique process IDs. / sinfo("g_npidhash == 4\n");

g_npidhash = 4; while (g_npidhash <= CONFIG_SMP_NCPUS) { g_npidhash <<= 1; }

g_pidhash = kmm_zalloc(sizeof(g_pidhash) g_npidhash); DEBUGASSERT(g_pidhash);

/* IDLE Group Initialization **/

for (i = 0; i < CONFIG_SMP_NCPUS; i++) { int hashndx;

  /* Assign the process ID(s) of ZERO to the idle task(s) */

  hashndx            = PIDHASH(i);
  g_pidhash[hashndx] = &g_idletcb[i].cmn;

  /* Allocate the IDLE group */

  sinfo("g_npidhash == 4 ----1 \n");
  DEBUGVERIFY(group_allocate(&g_idletcb[i], g_idletcb[i].cmn.flags));
  sinfo("g_npidhash == 4 ----2 \n");
  g_idletcb[i].cmn.group->tg_info->argv = &g_idleargv[i][0];
  sinfo("g_npidhash == 4 ----3 \n");

ifdef CONFIG_SMP

  /* Create a stack for all CPU IDLE threads (except CPU0 which already
   * has a stack).
   */

  if (i > 0)
    {
      DEBUGVERIFY(up_cpu_idlestack(i, &g_idletcb[i].cmn,
                                   CONFIG_IDLETHREAD_STACKSIZE));
    }

endif

JamesZhou2023 commented 7 months ago

@PetervdPerk-NXP More info: If I modify "Optimization Level" to "Suppress Optimization" or "custom Optimization", it always works fine.

I am unsure whether this issue is a problem with MIMXRT1170 or a problem with the entire 12.4 system.

PetervdPerk-NXP commented 7 months ago

Could you check if your problems occur on this commit ? https://github.com/apache/nuttx/commit/9906163bebdfa121b6266917f7413b961206510d

JamesZhou2023 commented 7 months ago

Is V12.4 the first version to include the 1170EVK?

I don't have any other NXP development boards.

PetervdPerk-NXP commented 7 months ago

The https://github.com/apache/nuttx/commit/9906163bebdfa121b6266917f7413b961206510d commit is the first commit supporting 1170EVK.

JamesZhou2023 commented 7 months ago

I checked out the code based on 2023-12-8, and it has the same behaviors as Ver 12.4.

PetervdPerk-NXP commented 7 months ago

Which toolchain are you using? I'm running the following

arm-none-eabi-gcc (GNU Arm Embedded Toolchain 9-2020-q2-update) 9.3.1 20200408 (release)
JamesZhou2023 commented 7 months ago

arm-none-eabi-gcc (15:9-2019-q4-0ubuntu1) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]

JamesZhou2023 commented 7 months ago

I update my toolchain to the latest version, but the problem still exist.

arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10.3-2021.10) 10.3.1 20210824 (release)

JamesZhou2023 commented 7 months ago

@PetervdPerk-NXP

Can you reproduce this issue in your environment with the original V12.4 code?

In my environment, if I use the original V12.4 release code and use the "imxrt1170-evk:nsh" configuration, this issue can be reproduced 100%.