Skip to content

Conversation

@FRASTM
Copy link
Contributor

@FRASTM FRASTM commented Aug 2, 2024

following the #76097

This one is adding the READOUT protection (RDP) for the stm32h7 serie

Tested on the stm32h745i disco with tests/drivers/flash/stm32/ with CONFIG_FLASH_STM32_READOUT_PROTECTION=y

*** Booting Zephyr OS build v3.7.0-449-ge7cd0f0307a2 ***                                                               
Running TESTSUITE flash_stm32                                                                                          
===================================================================                                                    
START - test_stm32_readout_protection_disabled                                                                         
RDP is disabled                                                                                                        
 PASS - test_stm32_readout_protection_disabled in 0.002 seconds                                                        
===================================================================                                                    
TESTSUITE flash_stm32 succeeded                                                                                        
                                                                                                                       
------ TESTSUITE SUMMARY START ------                                                                                  
                                                                                                                       
SUITE PASS - 100.00% [flash_stm32]: pass = 1, fail = 0, skip = 0, total = 1 duration = 0.002 seconds                   
 - PASS - [flash_stm32.test_stm32_readout_protection_disabled] duration = 0.002 seconds                                
                                                                                                                       
------ TESTSUITE SUMMARY END ------                                                                                    
                                                                                                                       
===================================================================                                                    
PROJECT EXECUTION SUCCESSFUL          

@FRASTM
Copy link
Contributor Author

FRASTM commented Aug 2, 2024

Also tested on the stm32h750b_dk to answer the #76297

@FRASTM FRASTM force-pushed the stm32h7_rdp branch 2 times, most recently from 4bfa791 to 5a24884 Compare August 2, 2024 12:20
@duda-patryk
Copy link
Contributor

@FRASTM Is there any progress on that? I'm interested in support for RDP and WP for STM32H7 chips

@FRASTM FRASTM force-pushed the stm32h7_rdp branch 3 times, most recently from 5956fa8 to 06e9555 Compare September 2, 2024 12:11
@FRASTM
Copy link
Contributor Author

FRASTM commented Sep 2, 2024

Changed with common ex_op functions for stm32h7 and other series
Fix build error with google_dragonclaw (stm32F4)

@FRASTM FRASTM force-pushed the stm32h7_rdp branch 3 times, most recently from 48d33e4 to d2bb852 Compare September 4, 2024 13:21
@FRASTM FRASTM marked this pull request as ready for review September 5, 2024 07:06
@erwango
Copy link
Member

erwango commented Sep 5, 2024

@benediktibk Thanks for the initial review on this. Would you mind resolving conversations on addressed points when you have some free cycles ?

@benediktibk
Copy link
Contributor

@benediktibk Thanks for the initial review on this. Would you mind resolving conversations on addressed points when you have some free cycles ?

Done, but I was only able to comment on the reviews where they were done. As I am neither the PR owner nor have write access to the repo github won't let me resolve my own conversations :-|

@niedzwiecki-dawid
Copy link
Member

Can I somehow help to get this merged? :-)

Place the flash_stm32_sem_take and flash_stm32_sem_give
function to header file for common to use in any flash driver

Signed-off-by: Francois Ramu <[email protected]>
Move the stm32 flash driver ex_op functions to common
flash_stm32_ex_op.c file.

Signed-off-by: Francois Ramu <[email protected]>
Implement the readout protection for the STM32H7 series.
Define the specific functions used by the flash_stm32h7.
Move the stm32h7 flash register manipulation in a write_optb()
to be called by the flash_stm32_set_rdp_level.

Signed-off-by: Francois Ramu <[email protected]>
@FRASTM
Copy link
Contributor Author

FRASTM commented Nov 28, 2024

  1. drivers: flash: stm32h7 flash has a write_optb function to set rdp level squash into drivers: flash: stm32h7 with RDP protection
  2. remove reference to H7 serie in the first change of flash_stm32.c
  3. restore the #if defined(CONFIG_MULTITHREADING) || defined(CONFIG_STM32H7_DUAL_CORE)
  4. rebase

duda-patryk
duda-patryk previously approved these changes Dec 2, 2024
@benediktibk
Copy link
Contributor

Minor issue, but there are still the copy paste left-overs for the licensing, see my comments above.

@FRASTM
Copy link
Contributor Author

FRASTM commented Dec 4, 2024

Minor issue, but there are still the copy paste left-overs for the licensing, see my comments above.

Sorry @benediktibk I cannot retrieve that, could you please point it ?

@benediktibk
Copy link
Contributor

The review comments are actually still open, they are about the *.overlay files in this PR. In there you still have SILA in the license information, probably a copy-paste leftover.

@fabiobaltieri fabiobaltieri assigned erwango and unassigned de-nordic Dec 6, 2024
Add the configuration to run the testcase
with READOUT_PROTECTION (RDP) on stm32h7 disco kits

Signed-off-by: Francois Ramu <[email protected]>
@FRASTM
Copy link
Contributor Author

FRASTM commented Dec 6, 2024

The review comments are actually still open, they are about the *.overlay files in this PR. In there you still have SILA in the license information, probably a copy-paste leftover.

Ok I see, correcting

@kartben kartben merged commit df86315 into zephyrproject-rtos:main Dec 9, 2024
24 checks passed
return rc;
}

regs->OPTCR = (regs->OPTCR & ~mask) | value;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't OPTSR_PRG be used here? Sorry for late comment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FRASTM ping :-)

@MaazSk
Copy link

MaazSk commented Jan 28, 2025

Sorry for late comment I tried the test on stm32h750b_dk but I got the following error. The error was 134 which means Not supported.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants