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 2020/11/03 14:49:21 UTC

[GitHub] [incubator-nuttx] lukegluke opened a new pull request #2209: stm32f7/stm32_serial.c: fix console re-initialisation if DMA enabled

lukegluke opened a new pull request #2209:
URL: https://github.com/apache/incubator-nuttx/pull/2209


   ## Summary
   Without this patch if serial console is configured to work with DMA (RX or TX) on stm32f7, it can cause a hardfault if something tries to write to console on boot.
   issue #1598 
   
   ## Impact
   stm32f7 boards now can correctly use serial console with enabled DMA
   
   ## Testing
   Tested with stm32f7 custom board within project based on PX4 
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on pull request #2209: stm32f7/stm32_serial.c: fix console re-initialisation if DMA enabled

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #2209:
URL: https://github.com/apache/incubator-nuttx/pull/2209#issuecomment-721218175


   Hi @davids5 and @lukegluke doesn't SERIAL_HAVE_CONSOLE_DMA imply both TX and RX? BTW, if it fix your issue and doesn't introduce any issue on PX4 side, it is fine. But I is strange that we need to make explicit CONSOLE_DMA for TX or RX...


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] lukegluke commented on pull request #2209: stm32f7/stm32_serial.c: fix console re-initialisation if DMA enabled

Posted by GitBox <gi...@apache.org>.
lukegluke commented on pull request #2209:
URL: https://github.com/apache/incubator-nuttx/pull/2209#issuecomment-721218363


   > @lukegluke - is this related to the other issues you were seeing?
   
   What do you mean by other issues? Issue with USB console is the separate one.
   
   > IIRC We have RX DMA on, on all the F7 HW, So why were you seeing a hardfault and the PX4 test rack is not?
   
   As I mentioned in issue description:
   > This can leads to hardfault when trying to write with not yet initialized serial dma in case when serial is used for console and something try to write to console on boot (for example board_hardfault_init in px4 can write to syslog (and to console if CONFIG_SYSLOG_CONSOLE defined)
   
   I don't remember details, but it seems that I encountered on hardfault, just when I added CONFIG_SYSLOG_CONSOLE in my board configuration, while non of the px4 boards have this config option.
   (and maybe it was also caused by my misunderstanding of CONFIG_DEV_CONSOLE default value :)
   So in the end I think it's not the problem for current PX4.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis edited a comment on pull request #2209: stm32f7/stm32_serial.c: fix console re-initialisation if DMA enabled

Posted by GitBox <gi...@apache.org>.
acassis edited a comment on pull request #2209:
URL: https://github.com/apache/incubator-nuttx/pull/2209#issuecomment-721218175


   Hi @davids5 and @lukegluke doesn't SERIAL_HAVE_CONSOLE_DMA imply both TX and RX? BTW, if it fixes your issue and doesn't introduce any issue on PX4 side, it is fine. But I is strange that we need to make explicit CONSOLE_DMA for TX or RX...


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 merged pull request #2209: stm32f7/stm32_serial.c: fix console re-initialisation if DMA enabled

Posted by GitBox <gi...@apache.org>.
davids5 merged pull request #2209:
URL: https://github.com/apache/incubator-nuttx/pull/2209


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] lukegluke commented on pull request #2209: stm32f7/stm32_serial.c: fix console re-initialisation if DMA enabled

Posted by GitBox <gi...@apache.org>.
lukegluke commented on pull request #2209:
URL: https://github.com/apache/incubator-nuttx/pull/2209#issuecomment-721220884


   > Hi @davids5 and @lukegluke doesn't SERIAL_HAVE_CONSOLE_DMA imply both TX and RX? BTW, if it fixes your issue and doesn't introduce any issue on PX4 side, it is fine. But I is strange that we need to make explicit CONSOLE_DMA for TX or RX...
   
   Hi @acassis. I fixed this issue by just defining general SERIAL_HAVE_CONSOLE_DMA as in stm32 (see #1598), but then I notice that there is separate defines for TX and RX (because stm32f7 support both) added by David, so within this PR I just adjust for current defines.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] lukegluke edited a comment on pull request #2209: stm32f7/stm32_serial.c: fix console re-initialisation if DMA enabled

Posted by GitBox <gi...@apache.org>.
lukegluke edited a comment on pull request #2209:
URL: https://github.com/apache/incubator-nuttx/pull/2209#issuecomment-721227839


   > IIRC We have RX DMA on, on all the F7 HW
   
   @davids5, in fact you're wrong here. I've just checked - only several F4 boards (fmu-v2, v3, v4) have RX DMA on console. I don't see any F7 board with RX DMA on console UART.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on pull request #2209: stm32f7/stm32_serial.c: fix console re-initialisation if DMA enabled

Posted by GitBox <gi...@apache.org>.
davids5 commented on pull request #2209:
URL: https://github.com/apache/incubator-nuttx/pull/2209#issuecomment-721197070


   @lukegluke - is this related to the other issues you were seeing? IIRC We have RX DMA on, on all the F7 HW, So why were you seeing a hardfault and the PX4 test rack is not?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on pull request #2209: stm32f7/stm32_serial.c: fix console re-initialisation if DMA enabled

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #2209:
URL: https://github.com/apache/incubator-nuttx/pull/2209#issuecomment-721331684


   > > Hi @davids5 and @lukegluke doesn't SERIAL_HAVE_CONSOLE_DMA imply both TX and RX? BTW, if it fixes your issue and doesn't introduce any issue on PX4 side, it is fine. But I is strange that we need to make explicit CONSOLE_DMA for TX or RX...
   > 
   > Hi @acassis. I fixed this issue by just defining general SERIAL_HAVE_CONSOLE_DMA as in stm32 (see #1598), but then I notice that there is separate defines for TX and RX (because stm32f7 support both) added by David, so within this PR I just adjust for current defines.
   
   Hi @lukegluke thanks for explanation, now I recall about it. David decided to separate both DMAs sometime ago. So I think your fix is correct. @davids5 can we merge it?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] lukegluke commented on pull request #2209: stm32f7/stm32_serial.c: fix console re-initialisation if DMA enabled

Posted by GitBox <gi...@apache.org>.
lukegluke commented on pull request #2209:
URL: https://github.com/apache/incubator-nuttx/pull/2209#issuecomment-721227839


   > IIRC We have RX DMA on, on all the F7 HW
   
   @davids5, in fact you're wrong here. I've just checked - only two F4 boards fmu-v2 and fmu-v4 have RX DMA.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] lukegluke edited a comment on pull request #2209: stm32f7/stm32_serial.c: fix console re-initialisation if DMA enabled

Posted by GitBox <gi...@apache.org>.
lukegluke edited a comment on pull request #2209:
URL: https://github.com/apache/incubator-nuttx/pull/2209#issuecomment-721227839


   > IIRC We have RX DMA on, on all the F7 HW
   
   @davids5, in fact you're wrong here. I've just checked - only several F4 boards (fmu-v2, v3, v4) have RX DMA. I don't see any F7 board with RX DMA on console UART.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org