-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail to pass samples/subsys/nvs #24237
Comments
@Laczen any hints on this one? |
@ABOSTM, the bug is not a bug, it is supposed to do this. After 10 cycles the item with ID=4 is deleted, so it should not show anymore. Regarding the error on the frdm_k64f, I think this device has a pagesize of 0x1000, so only two pages will fit in the storage area. The test requires 3 pages so the initialisation will fail. Changing the test to only use 2 pages should remove this error. |
@Laczen if not failing, is there any way to get a "passed" verdict when running the sample with sanitycheck? |
@erwango, this is a sample to help people gettings started with nvs. This sample is no test whatsoever so there should never be any conclusion about a run with sanitycheck. |
@erwango, if there is a need to get this "passed" verdict, please feel free to remove the sample. |
@Laczen this is not helping |
@erwango, OK, let us restart. The nvs sample is a sample, as many samples it is not really usefull to run it by sanitycheck. But suppose it is run by sanitycheck, what would you like to conclude from this? I hope you would not conclude that everything is OK if you are getting the same result as a preprogrammed result. The output of the sample is dependent on the configuration of the storage area (the sector size, the page size, the write block size, ...) and these are soc dependent. The sample could easily be changed to stop after 10 reboots and to check that the delete is properly performed. But at that moment there has been no 'garbage collection', after how many moments the 'garbage collection' is performed is configuration dependent. Stopping after 10 reboots is clearly not an option. |
Hi, @Laczen and @erwango I have tried to do as @erwango in #19895 setting flash region to 0x100000 (1M) and size to 0x8000 but no matter what I try it either gives me an invalid flash configuration (which I then disabled in nvs.c to see if it would help, but no) or that nvs_write() fails with error: -5 Let me know if you want me to test something. |
Hi @akofoed, on the nucleo-F411RE and nucleo-429zi is the first line "Flash Init failed" ? For the nvs sample to work the following conditions must be OK: Typical examples that will not work: Do the nucleo-F411RE and nucleo-429zi meet all required conditions ? |
for the nucleo_429zi, I get the following output (zephyr master updated a few days ago):
The following DTS storage_partition is used: |
The DTS only says where and how much, not sector count. |
This is not exactly true, the dts says size is 32kB, the page info says that these are 16kB sectors, this means that you can only have two sectors in there. |
Ups, you are correct. I have now changed the DTS size to 64KB (all 4 sectors):
Output is still the same:
|
Please undo changes that are hiding init errors. I can only guess that there is something wrong because it is hidden. Probably (but this is a guess) there was already some data in the flash region and it needs to be cleared before first use, but then again this is only a guess. |
Sure. I have now done a full-chip-erase (STM32CubeProgrammer) and this is the output below just after doing a "west flash" using minicom as term.
|
It seems nothing is written at all (alloc wra does not change). This seems like a more general flash failure. I think the board definition for the STM32F429ZI is missing some vital information. As I do not have the these boards it is impossible for me to find out exactly what is wrong. I think it is related to #23997. |
@akofoed, I think it is because the stm32f429zi is missing a |
The DTS for the 429zi do inherit the compatible="st,stm32f4-flash-controller" from the top SOC DTS file (stm32f4.dtsi). In the mean time I found out that for the STM32F4, the write-block-size= < 1 > and erase-block-size is missing. This is not the case for the STM32L476 (which correctly inherits write-block-size = < 8 > and erase-block-size = < 2048 >), but running it on the nucleo_l476rg board using this overlay file:
Still does not work (run after mass erase):
|
@akofoed, for the 429zi there is no fixed erase block size, that is why you can't find it. Could you check that the error (of each write) is still -5 (I was only guessing). |
The nucleo_l476 says -5 modifying main.c line 102 to:
Gives -5 adding 192.168.1.1:
|
@akofoed, the error -5 (-EIO) is coming directly from the flash driver. |
Interesting... I checked out zephyr-v2.2.0 as you suggested and it works on the nucleo_l476:
|
OK, you could try the same with the stm32f429zi (with the correct dts or overlay file). |
zephyr-v2.2.0 works on the F429 (nucleo_f429zi):
However, I have modified the flash area:
Else with default DTS I get:
|
@akofoed, thanks for the tests. The default dts is to be expected, the sectorsize is too large and will not fit 3 sectors. So to summarize: Could you file a bug report for item b? For item a. could you create a PR ? Thanks |
Closing since this has been covered by #24357 and the DTS for stm32f429zi will be a PR |
Describe the bug
I tried to run samples/subsys/nvs on disco_l475_iot,
but after some reboots (expected in this test),
it fails to read :
To Reproduce
Steps to reproduce the behavior:
west flash
console:
Preanalysis:
Analysing this issue, I found that function
nvs_read_hist()
returns with-ENOENT
. But then I am a bit lost with aet management.The same tests fails on nucleo_l4r5zi and stm32f3_disco.
Also @erwango tested board: frdm_k64f and test is failed too, but log is slightly different (see below).
Environment :
The text was updated successfully, but these errors were encountered: