You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/10/13 17:52:28 UTC
[GitHub] [incubator-nuttx] fjpanag opened a new issue, #7307: System does not start on STM32 when CONFIG_STACK_CANARIES is enabled.
fjpanag opened a new issue, #7307:
URL: https://github.com/apache/incubator-nuttx/issues/7307
When I enable the option `CONFIG_STACK_CANARIES` is not running.
It builds correctly, I flash it to the board, but `main()` is never entered. Somehow this option breaks the build.
This is affecting some arch'es but not all.
I have tried this option on simulator where everything runs fine. Specifically on STM32 however there is a problem.
---
Things I tried so far:
I used my debugger to see what is going on when the system hangs.
The program always hangs in function `stm32_rcc_enablelsi()`, file stm32_lsi.c, specifically at line 64.
The code cannot exit the loop.
I tried to remove this loop (or make it exit with my debugger), but the code immediately halts to the next similar loop.
It is not the specific check that causes the issue.
I disassembled the code both when the option is enabled or disabled.
The assembly is identical, no wrong instructions there.
I followed the assembly with my debugger, and everything seemed fine.
I checked the register address (`STM32_RCC_CSR`) that is loaded on the CPU register, and it is identical in both cases, and correct.
Just after, the CPU loads the contents of the register `STM32_RCC_CSR` to a CPU register.
The following values are read:
* Without stack canaries: 0x14000003
* With stack canaries: 0x14000000
Due to a reason that my brain cannot comprehend, this option somehow affects how the CPU reads the hardware registers, or something like that. I have spend a fair amount of time on this, and I cannot understand the issue. I am out of ideas now.
*(A hardware issue is completely ruled out.)*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] pkarashchenko commented on issue #7307: System does not start on STM32 when CONFIG_STACK_CANARIES is enabled.
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on issue #7307:
URL: https://github.com/apache/nuttx/issues/7307#issuecomment-1364564149
I just tried `CONFIG_STACK_CANARIES=y` with `same70-qmtech:nsh` board and it seems to be working. Will try with STM32 later
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] fjpanag commented on issue #7307: System does not start on STM32 when CONFIG_STACK_CANARIES is enabled.
Posted by GitBox <gi...@apache.org>.
fjpanag commented on issue #7307:
URL: https://github.com/apache/nuttx/issues/7307#issuecomment-1362882188
I experience a very similar issue on an LPC1769. I see that somewhere inside `__start()` an unexpected IRQ is happening, and the system panics.
This is only happening when `CONFIG_STACK_CANARIES` is enabled.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] pkarashchenko commented on issue #7307: System does not start on STM32 when CONFIG_STACK_CANARIES is enabled.
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on issue #7307:
URL: https://github.com/apache/nuttx/issues/7307#issuecomment-1364581505
I just checked `CONFIG_STACK_CANARIES=y` with `STM32F407VE` based board and it reached NSH console without any issues. Maybe there are some other options that give side effect in combination with `CONFIG_STACK_CANARIES`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] acassis commented on issue #7307: System does not start on STM32 when CONFIG_STACK_CANARIES is enabled.
Posted by GitBox <gi...@apache.org>.
acassis commented on issue #7307:
URL: https://github.com/apache/incubator-nuttx/issues/7307#issuecomment-1282388313
I tested enabling CONFIG_STACK_CANARIES for ESP32 and worked fine. Seems to be really specific for STM32. I will try later on STM32F4Discovery board to confirm
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org