You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "jfbblue0922 (via GitHub)" <gi...@apache.org> on 2024/05/15 06:07:37 UTC

[PR] add stm32h755II chip [nuttx]

jfbblue0922 opened a new pull request, #12350:
URL: https://github.com/apache/nuttx/pull/12350

   Adds compatibility with PX4 NuttX for use with JAE flight controllers.
   Here are the changes:
   ・Added setting ARCH_CHIP_STM32H755II
   ・Add stm32h7x5xx_rcc.c
   ・Corrected so that STM32_PWR_CR3_SCUEN is not enabled when SMPS SUPPLY is not used.
   


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #12350:
URL: https://github.com/apache/nuttx/pull/12350


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#issuecomment-2115293993

   @jfbblue0922 please squash the commits:
   
   https://nuttx.apache.org/docs/latest/contributing/making-changes.html#how-to-include-the-suggestions-on-your-pull-request


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#issuecomment-2117610192

   oops, sorry @davids5 I just saw the approaved and thought is was fixed already.


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#issuecomment-2122508828

   @jfbblue0922 - the Kconfig will need to contain a section, that the chip will enable modes for that package. The user can select mode for that, It is critical that the default for this change defaults to the Exact behavior before this change is applied.
   
   So there should be only RCC file (remove the added one) and the #ifdef logic to pick the correct values and set up. If the users does not select  the default used the same set up as before this change comes in.
   
   
   The mechanics do correct this: 1) Could be a NEW second PR with only the fixes. OR  2) @acassis  should revert the one he merged on accident and you do a new complete PR.


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on code in PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#discussion_r1604680979


##########
arch/arm/src/stm32h7/stm32_rcc.c:
##########
@@ -59,7 +59,7 @@
 #elif defined(CONFIG_STM32H7_STM32H7B3XX)
 #  include "stm32h7x3xx_rcc.c"
 #elif defined(CONFIG_STM32H7_STM32H7X5XX)
-#  include "stm32h7x3xx_rcc.c"
+#  include "stm32h7x5xx_rcc.c"

Review Comment:
   @jfbblue0922 I was suggesting you do not duplicate the stm32h7x5xx_rcc but use stm32h7x3xx_rcc file with just the single `Ifdef` for the changes from 3 to 5 



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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#issuecomment-2117591129

   @acassis Why did you merge this with a request to change it open?


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#issuecomment-2113397971

   @jfbblue0922 What is the diff from the the exiting rcc look like?  


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "jfbblue0922 (via GitHub)" <gi...@apache.org>.
jfbblue0922 commented on PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#issuecomment-2121557049

   @acassis
   
   It turns out that this problem is not specific to stm32h755II.
   There are 6 power supply methods for stm32h7.
   We use '1.LDO supply' instead of '2.Direct SMPS supply' method.
   Therefore, I would like to define CONFIG_STM32H7_PWR_LDO_SUPPLY macro, what do you think?
   
   
   Now that this PR has been merged, should I create another PR and fix it?
   ![Uploading fig1.png…]()
   


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "jfbblue0922 (via GitHub)" <gi...@apache.org>.
jfbblue0922 commented on PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#issuecomment-2117110960

   @acassis
   
   I did squash the commits.
   


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on code in PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#discussion_r1602775243


##########
arch/arm/src/stm32h7/stm32_rcc.c:
##########
@@ -59,7 +59,7 @@
 #elif defined(CONFIG_STM32H7_STM32H7B3XX)
 #  include "stm32h7x3xx_rcc.c"
 #elif defined(CONFIG_STM32H7_STM32H7X5XX)
-#  include "stm32h7x3xx_rcc.c"
+#  include "stm32h7x5xx_rcc.c"

Review Comment:
   @jfbblue0922 There is always a trade off to avoid #ifdef rash and having to maintain 2 IP Block files. 
   
   In this case A single `if def` is the better choice. If you can define a Single bit mask for the STM32H755II and one for the others.
   
   Then the code does a mask out and an OR in.
   
   In the top of the file define (Check the default of the mask out value and you may need to defines here, adjust the names a needed.)
   
   ```
   #if defined(ARCH_CHIP_STM32H755II)
   #  define PWR_CR3_VALUE  STM32_PWR_CR3_LDOEN 
   #else
   #  define PWR_CR3_VALUE  STM32_PWR_CR3_LDOEN|STM32_PWR_CR3_SCUEN 
   #endif
   ```
   
   Then Change the code to do the mask out as you have it.
   and `regval |= PWR_CR3_VALUE`
   
   The code stays readable and the maintenance will be free.



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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on code in PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#discussion_r1602775243


##########
arch/arm/src/stm32h7/stm32_rcc.c:
##########
@@ -59,7 +59,7 @@
 #elif defined(CONFIG_STM32H7_STM32H7B3XX)
 #  include "stm32h7x3xx_rcc.c"
 #elif defined(CONFIG_STM32H7_STM32H7X5XX)
-#  include "stm32h7x3xx_rcc.c"
+#  include "stm32h7x5xx_rcc.c"

Review Comment:
   @jfbblue0922 There is always a trade off to avoid #ifdef rash and having to maintain 2 IP Block files. In this case 
   
   A single `if def` is the better choice. If you can define a Single bit mask for the STM32H755II and one for the others.
   
   The the code does a mask out and an OR in.
   
   In the top of the file define Check the default of the mask out value and you may need to defines here, adjust the names a needed.
   
   ```
   #if defined(ARCH_CHIP_STM32H755II)
   #  define PWR_CR3_VALUE  STM32_PWR_CR3_LDOEN 
   #else
   #  define PWR_CR3_VALUE  STM32_PWR_CR3_LDOEN|STM32_PWR_CR3_SCUEN 
   #endif
   ```
   
   Then Change the code to do the mask out as you have it.
   and `regval |= PWR_CR3_VALUE`
   
   The code stays readable and the maintenance will be free.



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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#issuecomment-2120377321

   @jfbblue0922 something like:
   
   ```
   #if defined(CONFIG_ARCH_CHIP_STM32H755II)
   #define STM32_PWR_CR3_VALUE (STM32_PWR_CR3_LDOEN)
   #else
   #define STM32_PWR_CR3_VALUE (STM32_PWR_CR3_LDOEN | STM32_PWR_CR3_SCUEN)
   #endif
   ```
   
   Then use the macro STM32_PWR_CR3_VALUE to enable the right bits in both cases.


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#issuecomment-2117625039

   @jfbblue0922 Please consider creating a macro that has different values for that STM32_PWR_CR3 depending on which model of microcontroller is defined.


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#issuecomment-2117615391

   This PR add a file with a #ifdef of  an undefined value and and is total code duplication. @acassis  How do you want to clean up your oops?


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on code in PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#discussion_r1602775243


##########
arch/arm/src/stm32h7/stm32_rcc.c:
##########
@@ -59,7 +59,7 @@
 #elif defined(CONFIG_STM32H7_STM32H7B3XX)
 #  include "stm32h7x3xx_rcc.c"
 #elif defined(CONFIG_STM32H7_STM32H7X5XX)
-#  include "stm32h7x3xx_rcc.c"
+#  include "stm32h7x5xx_rcc.c"

Review Comment:
   @jfbblue0922 There is always a trade off to avoid #ifdef rash and having to maintain 2 IP Block files. 
   
   In this case A single `if def` is the better choice. If you can define a Single bit mask for the STM32H755II and one for the others.
   
   Then the code does a mask out and an OR in.
   
   In the top of the file define Check the default of the mask out value and you may need to defines here, adjust the names a needed.
   
   ```
   #if defined(ARCH_CHIP_STM32H755II)
   #  define PWR_CR3_VALUE  STM32_PWR_CR3_LDOEN 
   #else
   #  define PWR_CR3_VALUE  STM32_PWR_CR3_LDOEN|STM32_PWR_CR3_SCUEN 
   #endif
   ```
   
   Then Change the code to do the mask out as you have it.
   and `regval |= PWR_CR3_VALUE`
   
   The code stays readable and the maintenance will be free.



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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "jfbblue0922 (via GitHub)" <gi...@apache.org>.
jfbblue0922 commented on PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#issuecomment-2114250960

   @acassis
   
   Thank you for your advice.
   I've corrected the file.
   
   
   @davids5
   
   I created a new stm32h7x5xx_rcc.c based on the file stm32h7x3xx_rcc.c.
   The current stm32h7x3xx_rcc.c did not work correctly if CONFIG_STM32H7_PWR_DIRECT_SMPS_SUPPLY was disabled.
   
   ![diff](https://github.com/apache/nuttx/assets/113963003/98dca2b2-8919-465d-9a63-25762fdce37f)
   


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#issuecomment-2112553331

   Hi @jfbblue0922 thank you for your first contribution! I hope you attend our NuttX International Workshop in Japan next month (more info: https://events.nuttx.apache.org).
   
   Please fix the relative file path name at line 2 of stm32h7x5xx_rcc.c it is failing:
   
   ```
   7153852e8f add stm32h755II chip
   ../nuttx/tools/checkpatch.sh -u -m -g d1992497692e4265684b8211d665fd42936c3b62..HEAD
   Error: /home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/stm32h7/stm32h7x5xx_rcc.c:2:1: error: Relative file path does not match actual file
   Error: Process completed with exit code 1.
   ```


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on code in PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#discussion_r1602775243


##########
arch/arm/src/stm32h7/stm32_rcc.c:
##########
@@ -59,7 +59,7 @@
 #elif defined(CONFIG_STM32H7_STM32H7B3XX)
 #  include "stm32h7x3xx_rcc.c"
 #elif defined(CONFIG_STM32H7_STM32H7X5XX)
-#  include "stm32h7x3xx_rcc.c"
+#  include "stm32h7x5xx_rcc.c"

Review Comment:
   @jfbblue0922 There is always a trade off to avoid #ifdef rash and having to maintain 2 IP Block files. 
   
   In this case A single `if def` is the better choice. If you can define a Single bit mask for the STM32H755II and one for the others.
   
   Then the code does a mask out and an OR in.
   
   In the top of the file define (Check the default of the mask out value and you may need 2 defines here, adjust the names a needed.)
   
   ```
   #if defined(ARCH_CHIP_STM32H755II)
   #  define PWR_CR3_VALUE  STM32_PWR_CR3_LDOEN 
   #else
   #  define PWR_CR3_VALUE  STM32_PWR_CR3_LDOEN|STM32_PWR_CR3_SCUEN 
   #endif
   ```
   
   Then Change the code to do the mask out as you have it.
   and `regval |= PWR_CR3_VALUE`
   
   The code stays readable and the maintenance will be free.



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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "jfbblue0922 (via GitHub)" <gi...@apache.org>.
jfbblue0922 commented on PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#issuecomment-2120006918

   @davids5
   
   Thank you for your suggestions.
   
   I would like to revise it again according to your suggestions.
   
   I would like to modify it within stm32h7x3xx_rcc.c instead of creating stm32h7x5xx_rcc.c.
   
   
   @acassis
   
   Thank you for your advice.
   
   This PR has been merged and closed, but what should we do?
   
   How do I create a macro?
   


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


Re: [PR] add stm32h755II chip [nuttx]

Posted by "jfbblue0922 (via GitHub)" <gi...@apache.org>.
jfbblue0922 commented on code in PR #12350:
URL: https://github.com/apache/nuttx/pull/12350#discussion_r1604612950


##########
arch/arm/src/stm32h7/stm32_rcc.c:
##########
@@ -59,7 +59,7 @@
 #elif defined(CONFIG_STM32H7_STM32H7B3XX)
 #  include "stm32h7x3xx_rcc.c"
 #elif defined(CONFIG_STM32H7_STM32H7X5XX)
-#  include "stm32h7x3xx_rcc.c"
+#  include "stm32h7x5xx_rcc.c"

Review Comment:
   @davids5
   
   Thank you for your advice.
   I've corrected the file.
   
   It turns out that our board uses LOD_SUPPLY.
   Therefore, CONFIG_STM32H7_PWR_LDO_SUPPLY was added to stm32h7x5xx_rcc.c.
   
   Also, CONFIG_ARCH_CHIP_STM32H755II was added to stm32_rcc.c to include.
   



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