NRF52 : use of NFFS file system
Laurence Pasteau
Hi all,
Thanks having resolved my first issue on NFFS file system. I work on a nrf52_pca10040 board. My purpose is still to use the file system NFFS to fill the nrf52 flash.
My flash config booked half of the flash for the file system :
#if defined(CONFIG_FS_FLASH_STORAGE_PARTITION)
storage_partition: partition@40000 { label = "storage"; reg = <0x00040000 0x00040000>; }; #endif My test writes in loop 24 bytes in one or more files, as much as possible. (main_test.c attached) I find a configuration that writes successfully all flash in one single file :
CONFIG_SOC_FLASH_NRF=y
CONFIG_FS_NFFS_NUM_BLOCKS=1024 CONFIG_FS_NFFS_NUM_INODES=1024 CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1 CONFIG_FS_NFFS_NUM_CACHE_INODES=1 CONFIG_FS_NFFS_NUM_DIRS=4 CONFIG_FS_NFFS_NUM_FILES=10 #CONFIG_FS_NFFS_NUM_INODES=64 CONFIG_HEAP_MEM_POOL_SIZE=1024 CONFIG_MAIN_STACK_SIZE=4096 CONFIG_NFFS_FILESYSTEM_MAX_AREAS=64 #CONFIG_NFFS_FILESYSTEM_MAX_BLOCK_SIZE=4096 CONFIG_FS_FLASH_STORAGE_PARTITION=y CONFIG_SOC_FLASH_NRF_RADIO_SYNC=y Result test :
test_files : 1 nb files
Error -28 indicates that the flash is full.That's great.
file write error (-28) FILE : test1.bin size 235968 FILE : test2.bin size 0 FILE : test3.bin size 0 FILE : test4.bin size 0 FILE : test5.bin size 0
But when I write in 5 differents files, I can not write all the flash and I have another error :
Result test :
test_files : 5 nb files
file write error (-12) FILE : test1.bin size 20448 FILE : test2.bin size 20448 FILE : test3.bin size 20448 FILE : test4.bin size 20424 FILE : test5.bin size 20424 write4 error Attached is the little test used to have this result. It is a quick test with both success and error tests.
All tests with more than one file fails and I don't understand why. I don't know if my NFFS configuration is not good or if it is an issue in NFFS file ssytem.
If someone can help me it will be very helpful. Thanks in advance, Regards, Laurence
--- Laurence Pasteau 1 Avenue du Professeur Jean Rouxel, ZAC de la Fleuriaye, 44470 Carquefou
De : Cufi, Carles <Carles.Cufi@...>
Envoyé : vendredi 31 août 2018 18:50 À : Laurence Pasteau; Puzdrowski, Andrzej; Andrzej Kaczmarek Objet : RE: NRF52 : use of NFFS file system Thanks Laurence, I’ve assigned it and we will deal with it as soon as we can.
Regards,
Carles
From: Laurence Pasteau <laurence.pasteau@...>
Sent: 31 August 2018 18:08 To: Cufi, Carles <Carles.Cufi@...>; Puzdrowski, Andrzej <Andrzej.Puzdrowski@...>; Andrzej Kaczmarek <andrzej.kaczmarek@...> Subject: RE: NRF52 : use of NFFS file system
Here is the link : https://github.com/zephyrproject-rtos/zephyr/issues/9749
Regards, Laurence
De : Cufi, Carles <Carles.Cufi@...>
Hi Laurence,
Yes please, if you could open a GitHub issue and then send us the link here we will be able to track it better.
Regards,
Carles
From: Laurence Pasteau <laurence.pasteau@...>
Sorry, I meant 0x30000 and 0x40000...
De : Laurence Pasteau
Thanks Carles,
the test lasts one or two minutes but can be shorten if necessary. My purpose is to have half of the flash (0x4000 bytes) in the file system. I have now a configuration with a flash system of 0x3000 bytes that has less problem but it still happens. Files that are badly written are not recoverable, new weird files are not cleanable (with fs_unlink() function) so the system is not usable in my project for the moment.
If it is better, I can add an issue in github but I still don't know if I made a mistake in NFFS configuration or in the test, or if it is an issue in the file system.
Thanks in advance for any solution / idea / conclusions. Laurence De : Cufi, Carles <Carles.Cufi@...>
Hi Laurence,
I am copying a couple of people that might be able to help with NFFS config.
Carles
Hi everybody,
I worked on a board including a NRF52 and use the file system with NFFS but I never succeed in using it correctly.
I have a lot of errors depending on the configuration parameters that I set. I reduce my problem to a little test that only writes in a loop 12 bytes in a single file. It fails very quickly. Sometimes the operation seems good when checking the return value. However the file became a file of size null and a new file with another name appears with the previous file. Then some loops later, there is an error in a return value of the write function.
I tried to modify NFFS configuration. In the two cases when the CONFIG_NFFS_FILESYSTEM_MAX_BLOCK_SIZE is higher and when the global size of the file system is higher ; the test is good during a longer time before failing. If I write 24 instead of 12 bytes or if I write in two files instead of one, the issue comes sooner.
I think something in my configuration (or in my software) is wrong. If someone can help me it would be very helpful.
Attached is the little test and the conf file. To reduce the time before failing, I change the file system size to 0x2000.
Here is my configuration (I don't use MCU_BOOT) :
In the dts file : partitions {
In the conf file : CONFIG_SOC_FLASH_NRF=y
In the CMakeLists.txt : set(BOARD nrf52_pca10040) target_include_directories(app PRIVATE $ENV{ZEPHYR_BASE}/ext/fs/nffs/include)
Thanks in advance for any help.
Regards, Laurence
|
|
Re: Running Hello World for Dragino-LSN50 on B-L072Z-LRWAN1 Dicovery Board
Erwan Gouriou
Hi, Looking to B-L072Z-LRWAN1 user manual, it seems that you can get ST-Link VCP using USART2, Did you changed the console settings to match this configuration ? Then, fortunately, both boards share the same pin mapping on this UART, so on this point you should be fine. Last, one point to check would be the clock settings; Dragino uses HSI driven PLL, does this fit with B-L072Z-LRWAN1? Cheers
On Thu, 20 Sep 2018 at 22:16, Aleksandr Makarov <seems.deviant@...> wrote: Hello,
|
|
Running Hello World for Dragino-LSN50 on B-L072Z-LRWAN1 Dicovery Board
Aleksandr Makarov <seems.deviant@...>
Hello,
I am trying to run Hello World application built for Dragino-LSN50 on a B-L072Z-LRWAN1 Dicovery Board. Those two boards both are SM32L0-based and share exactly the same MCU model - SMT32L072CZY. The build process and device flashing work fine, however I can't see a "Hello World!" print on a COM terminal after a reset. A working USART port is the only peripheral I care for now. The USART pin configuration for Dragino LSN50 board should be suitable for L072Z- LRWAN1 as well, though it is not working. Please advice.
|
|
Choosing Tx Buffers in BLE stack
dhguja@gmail.com
Hello,
I am working on a BLE HID keyboard application using zephyr 1.13. I was playing around with Tx buffers (specifically Maximum number of pending TX buffers, Number of Tx buffers). With default buffer settings the characters were transmitted very slowly due to small number of buffers. But as soon as i increased it to 3 pending buffers and 3 Tx buffers i saw significant improvement in the speed of characters transmitted. My question is how to choose the buffer values for this?. The reason is currently i face a compatibility problem with my HID application, where it works fine in Linux, Android, iOS devices with increased number of buffers, but crashes on windows system. When i debugged the HCI log (from btmon) i saw that with increased buffers, characters are sent very quickly on the order of 500 us for each character. This causes the data (of 20 characters) to be transmitted within one or two connection intervals. Maybe this causes some overflow in windows systems. I would like to know what are the implications of choosing a number of Tx buffers and pending buffers. It will be helpful if anyone can tell how to choose the number of Tx buffers? or even point to some direction in the BLE specification? Thank you, Dhananjay G J
|
|
Re: MISRA-C and Zephyr
Flavio Ceolin
Hi Szymon,
Hello,Sure thing ! Next commits I'll add which rule that commits is fixing. Thanks for pointint it out :) Regards, Flavio Ceolin
|
|
Re: MISRA-C and Zephyr
Szymon Janc
Hello, I was wondering about where did void casting for functions like memcpy, memset comes from. Could commit messages for this point to specific rule?
On 14 September 2018 at 20:46, Flavio Ceolin <flavio.ceolin@...> wrote: Hi guys, --
pozdrawiam Szymon K. Janc
|
|
Re: MISRA-C and Zephyr
Reto Schneider <reto@...>
On 9/17/18 10:48 AM, Jiří Kubias wrote:
I have one practical question regarding MISRA-C standard. Where I canYou have to buy it. Is there any public description of this standard? There are many of usThis fairly new publication might help you: https://arxiv.org/abs/1809.00821 Kind regards, Reto
|
|
Re: cmake is not recognizing board variable set in CMakeLists.txt
Marti Bolivar <marti@...>
On Tue, Sep 18, 2018 at 4:04 AM Sathishkumar Duraisamy
<bewithsathish@gmail.com> wrote: The important thing is it must be set before you include the boilerplate file.
|
|
Re: cmake is not recognizing board variable set in CMakeLists.txt
Sathishkumar Duraisamy <bewithsathish@...>
On Tue, Sep 18, 2018 at 3:29 PM, Sathishkumar Duraisamy <bewithsathish@...> wrote:
It seems set(BOARD qemu_cortex_m3) has to be in the beginning of the file after cmake version. It works. -- Regards,
Sathishkumar D
|
|
cmake is not recognizing board variable set in CMakeLists.txt
Sathishkumar Duraisamy <bewithsathish@...>
Hi all, I am Sathishkumar. I am experimenting with zephyr and learning to contribute to it. I am coming form Linux and feels home with kconfig, dts, etc. As per the application primer, I have set(BOARD qemu_cortex_m3) in CMakeLists.txt. But cmake complaints : BOARD is not being defined on the CMake command-line in the environment or by the app. Are this expected?
|
|
Re: MPU fault while testing Bluetooth Mesh Sample demos
Jiří Kubias <jiri.kubias@...>
Hi, last night I have discovered that I have messed up variables and I have tried to assign value to constant variable -> that is the reason why I have received the MPU fault. Best regards, Jiri po 17. 9. 2018 v 16:29 odesílatel Jiří Kubias <jiri.kubias@...> napsal:
--
=================================================== Ing. Jiri Kubias e-mail: jiri.kubias@... mobile: 775 593 956 ===================================================
|
|
Re: MPU fault while testing Bluetooth Mesh Sample demos
Jiří Kubias <jiri.kubias@...>
Hi, In my case the MPU falut was stable. But in your case it looks like some race condition issue. Try to reorganise the initialisation or add some delays. Regards Jiri
|
|
Re: MPU fault while testing Bluetooth Mesh Sample demos
vikrant8051 <vikrant8051@...>
Hi Jiri, After replying to your email, I once again started testing thoroughly. And yes, once again I got MPU fault. Regards, Vikrant
On Mon, Sep 17, 2018 at 6:30 PM vikrant8051 <vikrant8051@...> wrote:
|
|
Re: SPI driver development
Jiří Kubias <jiri.kubias@...>
Hi Vincent, Im open minded 8-). I have implemented SPI driver with polling - seems to be working fine for moth ways. But configuration stuff need some recheck and only one CS is supported. I have tried to implement the DMA (I can compile it) into my driver but it fails when I bind the DMA - I have received MPU protection fault. Unfortunately there not many examples with DMA so it is not so simply to implement it... In another thread was reported also MPU fault with v1.13 which Im using. But it seems to be fixed in GIT so I have to recheck it again to see if the problem is still there or not. I would like to finish it this week but Im sharing my time with another projects.... I will also try to implement the flash driver - but I didnt started yet. Regards, Jiri 2018-09-17 15:07 GMT+02:00 <vincent@...>:
--
===================================================
Ing. Jiri Kubias e-mail: jiri.kubias@... mobile: 775 593 956 ===================================================
|
|
Re: SPI driver development
Vincent - VLoTech
Hi Jiri, Perhaps we can combine effort for this.
|
|
Re: MPU fault while testing Bluetooth Mesh Sample demos
vikrant8051 <vikrant8051@...>
HI Jiri, After latest sync with master, I've not faced MPU FAULT issue while testing. But it could be there. With v1.13, it could be suddenly pops-up without any reason (as a app developer) Thanks for linking your issue with this mailing list. Hope Zephyr core developers will resolve it. Regards, vikrant
On Mon, Sep 17, 2018 at 12:37 PM Jiří Kubias <jiri.kubias@...> wrote:
|
|
Looking for new maintainer for RPL
Ravi kumar Veeramally
Hello,
|
|
sensor.h "error: invalid conversion from ..."
Paul ADAM <paul.adam@...>
Hello,
when I am compiling sensor.h in a cpp file, I have following error 5 times: /home/.../zephyr/include/sensor.h: In function ‘int sensor_trigger_set(device*, sensor_trigger*, sensor_trigger_handler_t)’: /home/.../zephyr/include/sensor.h:339:45: error: invalid conversion from ‘const void*’ to ‘const sensor_driver_api*’ [-fpermissive] const struct sensor_driver_api *api = dev->driver_api; ~~~~~^~~~~~~~~~ The solution (if I do not want to let the compiler be more permissive) is to change the code like this: const struct sensor_driver_api *api = ( const struct sensor_driver_api * ) dev->driver_api; What do you think about? Is there another solution? Someone told me that this is required by MISRA-C standard. Do you confirm? Should I do a git pull request? Or can someone modify the code in the repository? Best regards Paul
|
|
Re: sensor.h "error: invalid conversion from ..."
Mark Ruvald Pedersen (MPED)
FYI, Zephyr is not MISRA-C compliant as Zephyr currently uses several GNU C extensions.
Some little work is ongoing to at least make Zephyr more C99 compliant.
MISRA-C Rule 1 (required): "All code shall conform to ISO 9899 standard C,
with no extensions permitted."
Regards, Mark
From: devel@... [devel@...] on behalf of Paul ADAM [paul.adam@...]
Sent: Monday, September 17, 2018 11:18 To: Zephyr-devel@... Subject: [Zephyr-devel] sensor.h "error: invalid conversion from ..." Hello,
when I am compiling sensor.h in a cpp file, I have following error 5 times: /home/.../zephyr/include/sensor.h: In function ‘int sensor_trigger_set(device*, sensor_trigger*, sensor_trigger_handler_t)’: /home/.../zephyr/include/sensor.h:339:45: error: invalid conversion from ‘const void*’ to ‘const sensor_driver_api*’ [-fpermissive] const struct sensor_driver_api *api = dev->driver_api; ~~~~~^~~~~~~~~~ The solution (if I do not want to let the compiler be more permissive) is to change the code like this: const struct sensor_driver_api *api = ( const struct sensor_driver_api * ) dev->driver_api; What do you think about? Is there another solution? I was told that this explicit conversion is required by MISRA-C standard. Do you confirm? Should I do a git pull request? Or can someone modify the code in the repository? Best regards Paul
|
|
sensor.h "error: invalid conversion from ..."
Paul ADAM <paul.adam@...>
Hello,
when I am compiling sensor.h in a cpp file, I have following error 5 times: /home/.../zephyr/include/sensor.h: In function ‘int sensor_trigger_set(device*, sensor_trigger*, sensor_trigger_handler_t)’: /home/.../zephyr/include/sensor.h:339:45: error: invalid conversion from ‘const void*’ to ‘const sensor_driver_api*’ [-fpermissive] const struct sensor_driver_api *api = dev->driver_api; ~~~~~^~~~~~~~~~ The solution (if I do not want to let the compiler be more permissive) is to change the code like this: const struct sensor_driver_api *api = ( const struct sensor_driver_api * ) dev->driver_api; What do you think about? Is there another solution? I was told that this explicit conversion is required by MISRA-C standard. Do you confirm? Should I do a git pull request? Or can someone modify the code in the repository? Best regards Paul
|
|