You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by then yon <yz...@free2move.se> on 2017/01/06 07:02:42 UTC

Getting Unhandled interrupt (17)

Dear Support,

I was working on ESB mode in myNewt; what i did was porting the working 
code from my original working eclipse code.

Some how i was stuck at the ESB_EVT_IRQ(SWI0_EGU0_IRQ), whenever i 
enable this interrupt it gave me the following error when receiving 
packet from ESB:
1069: > Unhandled interrupt (17), exception sp 0x20001cf0 29711: 
r0:0x00000011 r1:0x00000001 r2:0x50000000 r3:0x00020000 29711: 
r4:0x000179c5 r5:0x00000001 r6:0x20001928 r7:0x00008171 29711: 
r8:0x00000000 r9:0x00000000 r10:0x20000000 r11:0x00000000 
29711:r12:0x00000000 lr:0x000081a5 pc:0x0000819c psr:0x21000200 
29711:ICSR:0x00421811 HFSR:0x00000000 CFSR:0x00000000 
29711:BFAR:0xe000ed38 MMFAR:0xe000ed34

Can i know what is the meaning of that?

Please let me know if you need more info on this.

Thank you.

Regards,
Then Yoong Ze

Re: file system fs/fs not working after updated to latest myNewt

Posted by then yon <yz...@free2move.se>.
Dear Fabio,

After i clean and rebuild mynewt it worked!

Thanks for your help.

Regards,

Then Yoong Ze


On 15/2/2017 7:06 AM, Fabio Utzig wrote:
> The code you pasted works for me. Could you check if leaving nffs
> enabled but not calling read_config/write_config still triggers the
> exception?
>
> On Tue, Feb 14, 2017, at 08:18 PM, then yon wrote:
>> Dear Fabio,
>>
>> In the previous working version, i'm only included the followind:
>>
>> pkg.deps:
>>       - "@apache-mynewt-core/fs/fs"
>>       - "@apache-mynewt-core/fs/nffs"
>>
>> code:
>>      #include "fs/fs.h"
>>      #include "fs/fsutil.h"
>>      #include "nffs/nffs.h"
>> int write_config(void) { int rc; /* Create the parent directory. */ rc =
>> fs_mkdir("/cfg"); os_time_delay(1); if (rc != 0) { return -2; } //END if
>> // Create a file and write four bytes to it. rc =
>> fsutil_write_file("/cfg/config.txt <http://config.txt/>",
>> &system_cfg_desc.data_ch_addr <http://system_cfg_desc.data_ch_addr/>[0],
>> sizeof(SYSTEM_CONFIGURATION_DESC_T)); os_time_delay(1); return rc == 0 ?
>> 0 : -1; } //END write_config int read_config() { uint32_t bytes_read;
>> int rc; /* Read up to 15 bytes from the start of the file. */ rc =
>> fsutil_read_file("/cfg/config.txt <http://config.txt/>", 0,
>> sizeof(system_cfg_desc), &system_cfg_desc.data_ch_addr
>> <http://system_cfg_desc.data_ch_addr/>[0], &bytes_read);
>> os_time_delay(1); return rc == 0 ? 0 : -1; } //END read_config
>>
>>
>> Thank you.
>>
>> Regards,
>>
>> Then Yoong Ze
>>
>>
>> On 14/2/2017 11:08 PM, Fabio Utzig wrote:
>>> Hi,
>>>
>>> FAT doesn't format a FS (I didn't enable) so it expects an already
>>> formatted FS. FAT is also not appropriate to use with Flash if that's
>>> what you're using, because it doesn't have a concept of "erase" and it
>>> doesn't do wear leveling. I actualy only tested with MMC!
>>>
>>> I will do some testing today to try to find what is causing your problem
>>> with NFFS (or with no FS enabled).
>>>
>>> What FS operations are you doing? Are you using any of the fs_* calls?
>>> Could you copy/paste some of your FS usage code as a gist (or pastebin,
>>> etc)?
>>>
>>> Cheers,
>>> Fabio Utzig
>>>
>>> On Mon, Feb 13, 2017, at 02:57 AM, then yon wrote:
>>>> Dear Fabio,
>>>>
>>>> The previous working project, i include fs/nffs package; but when i
>>>> include on latest mynewt straight away it gave me exception so i
>>>> disabled it (it gave me exception even all the filesystem code removed).
>>>>
>>>> Below is the output with the fs/nffs included.
>>>>
>>>> newt target dep blink_nordic Dependency graph (depender -->
>>>> [dependees]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 --> [] *
>>>> @apache-mynewt-core/encoding/base64 --> [] * @apache-mynewt-core/fs/disk
>>>> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/fs/fs -->
>>>> [@apache-mynewt-core/fs/disk] * @apache-mynewt-core/fs/nffs -->
>>>> [@apache-mynewt-core/fs/fs @apache-mynewt-core/hw/hal
>>>> @apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map
>>>> @apache-mynewt-core/sys/log/full(api:log)
>>>> @apache-mynewt-core/sys/stats/full(api:stats)
>>>> @apache-mynewt-core/test/testutil @apache-mynewt-core/util/crc] *
>>>> @apache-mynewt-core/hw/bsp/nrf52dk -->
>>>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
>>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>>>> @apache-mynewt-core/libc/baselibc] * @apache-mynewt-core/hw/cmsis-core
>>>> --> [] * @apache-mynewt-core/hw/drivers/uart --> [] *
>>>> @apache-mynewt-core/hw/drivers/uart/uart_hal -->
>>>> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal] *
>>>> @apache-mynewt-core/hw/hal --> [@apache-mynewt-core/kernel/os] *
>>>> @apache-mynewt-core/hw/mcu/nordic --> [@apache-mynewt-core/hw/cmsis-core
>>>> @apache-mynewt-core/hw/hal] * @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>>>> --> [@apache-mynewt-core/compiler/arm-none-eabi-m4
>>>> @apache-mynewt-core/hw/cmsis-core @apache-mynewt-core/hw/hal
>>>> @apache-mynewt-core/hw/mcu/nordic] * @apache-mynewt-core/kernel/os -->
>>>> [@apache-mynewt-core/sys/console/full(api:console)
>>>> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/util/mem] *
>>>> @apache-mynewt-core/libc/baselibc --> [@apache-mynewt-core/kernel/os
>>>> @apache-mynewt-core/sys/console/full(api:console)] *
>>>> @apache-mynewt-core/sys/console/full -->
>>>> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal
>>>> @apache-mynewt-core/kernel/os] * @apache-mynewt-core/sys/defs --> [] *
>>>> @apache-mynewt-core/sys/flash_map --> [@apache-mynewt-core/sys/defs
>>>> @apache-mynewt-core/sys/mfg] * @apache-mynewt-core/sys/log/full -->
>>>> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map
>>>> @apache-mynewt-core/util/cbmem] * @apache-mynewt-core/sys/mfg -->
>>>> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map] *
>>>> @apache-mynewt-core/sys/shell --> [@apache-mynewt-core/encoding/base64
>>>> @apache-mynewt-core/kernel/os
>>>> @apache-mynewt-core/sys/console/full(api:console)
>>>> @apache-mynewt-core/time/datetime @apache-mynewt-core/util/crc] *
>>>> @apache-mynewt-core/sys/stats/full --> [@apache-mynewt-core/kernel/os] *
>>>> @apache-mynewt-core/sys/sysinit --> [@apache-mynewt-core/kernel/os
>>>> @apache-mynewt-core/sys/flash_map] * @apache-mynewt-core/test/testutil
>>>> --> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os
>>>> @apache-mynewt-core/sys/sysinit] * @apache-mynewt-core/time/datetime -->
>>>> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/util/cbmem -->
>>>> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os] *
>>>> @apache-mynewt-core/util/crc --> [] * @apache-mynewt-core/util/mem -->
>>>> [@apache-mynewt-core/kernel/os] * apps/blinky -->
>>>> [@apache-mynewt-core/fs/fs @apache-mynewt-core/fs/nffs
>>>> @apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os
>>>> @apache-mynewt-core/sys/console/full @apache-mynewt-core/sys/log/full
>>>> @apache-mynewt-core/sys/shell @apache-mynewt-core/sys/stats/full] *
>>>> targets/blink_nordic --> []
>>>> sensmaster@sensmaster-Inspiron-3542:~/myNewtProject/mynewtresearch/myNewtProj$
>>>> newt target revdep blink_nordic Reverse dependency graph (dependee <--
>>>> [dependers]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 <--
>>>> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>>>> @apache-mynewt-core/encoding/base64 <-- [@apache-mynewt-core/sys/shell]
>>>> * @apache-mynewt-core/fs/disk <-- [@apache-mynewt-core/fs/fs] *
>>>> @apache-mynewt-core/fs/fs <-- [@apache-mynewt-core/fs/nffs apps/blinky]
>>>> * @apache-mynewt-core/fs/nffs <-- [apps/blinky] *
>>>> @apache-mynewt-core/hw/cmsis-core <-- [@apache-mynewt-core/hw/mcu/nordic
>>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>>>> @apache-mynewt-core/hw/drivers/uart <--
>>>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
>>>> @apache-mynewt-core/sys/console/full] *
>>>> @apache-mynewt-core/hw/drivers/uart/uart_hal <--
>>>> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/hw/hal <--
>>>> [@apache-mynewt-core/fs/nffs
>>>> @apache-mynewt-core/hw/drivers/uart/uart_hal
>>>> @apache-mynewt-core/hw/mcu/nordic
>>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>>>> @apache-mynewt-core/sys/console/full @apache-mynewt-core/test/testutil
>>>> @apache-mynewt-core/util/cbmem apps/blinky] *
>>>> @apache-mynewt-core/hw/mcu/nordic <--
>>>> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx <--
>>>> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/kernel/os <--
>>>> [@apache-mynewt-core/fs/disk @apache-mynewt-core/fs/nffs
>>>> @apache-mynewt-core/hw/hal @apache-mynewt-core/libc/baselibc
>>>> @apache-mynewt-core/sys/console/full @apache-mynewt-core/sys/log/full
>>>> @apache-mynewt-core/sys/mfg @apache-mynewt-core/sys/shell
>>>> @apache-mynewt-core/sys/stats/full @apache-mynewt-core/sys/sysinit
>>>> @apache-mynewt-core/test/testutil @apache-mynewt-core/time/datetime
>>>> @apache-mynewt-core/util/cbmem @apache-mynewt-core/util/mem apps/blinky]
>>>> * @apache-mynewt-core/libc/baselibc <--
>>>> [@apache-mynewt-core/hw/bsp/nrf52dk] *
>>>> @apache-mynewt-core/sys/console/full <--
>>>> [@apache-mynewt-core/kernel/os(api:console)
>>>> @apache-mynewt-core/libc/baselibc(api:console)
>>>> @apache-mynewt-core/sys/shell(api:console) apps/blinky] *
>>>> @apache-mynewt-core/sys/defs <-- [@apache-mynewt-core/sys/flash_map] *
>>>> @apache-mynewt-core/sys/flash_map <-- [@apache-mynewt-core/fs/nffs
>>>> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/mfg
>>>> @apache-mynewt-core/sys/sysinit] * @apache-mynewt-core/sys/log/full <--
>>>> [@apache-mynewt-core/fs/nffs(api:log) apps/blinky] *
>>>> @apache-mynewt-core/sys/mfg <-- [@apache-mynewt-core/sys/flash_map] *
>>>> @apache-mynewt-core/sys/shell <-- [apps/blinky] *
>>>> @apache-mynewt-core/sys/stats/full <--
>>>> [@apache-mynewt-core/fs/nffs(api:stats) apps/blinky] *
>>>> @apache-mynewt-core/sys/sysinit <-- [@apache-mynewt-core/kernel/os
>>>> @apache-mynewt-core/test/testutil] * @apache-mynewt-core/test/testutil
>>>> <-- [@apache-mynewt-core/fs/nffs] * @apache-mynewt-core/time/datetime
>>>> <-- [@apache-mynewt-core/sys/shell] * @apache-mynewt-core/util/cbmem <--
>>>> [@apache-mynewt-core/sys/log/full] * @apache-mynewt-core/util/crc <--
>>>> [@apache-mynewt-core/fs/nffs @apache-mynewt-core/sys/shell] *
>>>> @apache-mynewt-core/util/mem <-- [@apache-mynewt-core/kernel/os]
>>>>
>>>>
>>>> Beside that i tried with fs/fatfs deps, it gave me no exception but the
>>>> data doesn't wrote into the filesystem. Do i need to do initialize on
>>>> fatfs?
>>>>
>>>> Thank you.
>>>>
>>>> Then Yoong Ze
>>>>
>>>>
>>>> On 11/2/2017 12:36 AM, Fabio Utzig wrote:
>>>>> Your english is just fine. What surprised me is that you're using the fs
>>>>> subsystem without any fs enabled (either having nffs or fatfs or both).
>>>>> I was not expecting it, never tried it myself and it might indeed be a
>>>>> bug.
>>>>>
>>>>> Cheers,
>>>>> Fabio Utzig
>>>>>
>>>>> On Fri, Feb 10, 2017, at 02:01 PM, then yon wrote:
>>>>>> Dear Fabio,
>>>>>>
>>>>>> That means i removed all the code related to fs and the package
>>>>>> dependencies. Sorry for my bad english.
>>>>>>
>>>>>> newt target dep blink_nordic
>>>>>>
>>>>>> Dependency graph (depender --> [dependees]): *
>>>>>> @apache-mynewt-core/compiler/arm-none-eabi-m4 --> [] *
>>>>>> @apache-mynewt-core/encoding/base64 --> [] * @apache-mynewt-core/fs/disk
>>>>>> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/fs/fs -->
>>>>>> [@apache-mynewt-core/fs/disk] * @apache-mynewt-core/hw/bsp/nrf52dk -->
>>>>>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
>>>>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>>>>>> @apache-mynewt-core/libc/baselibc] * @apache-mynewt-core/hw/cmsis-core
>>>>>> --> [] * @apache-mynewt-core/hw/drivers/uart --> [] *
>>>>>> @apache-mynewt-core/hw/drivers/uart/uart_hal -->
>>>>>> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal] *
>>>>>> @apache-mynewt-core/hw/hal --> [@apache-mynewt-core/kernel/os] *
>>>>>> @apache-mynewt-core/hw/mcu/nordic --> [@apache-mynewt-core/hw/cmsis-core
>>>>>> @apache-mynewt-core/hw/hal] * @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>>>>>> --> [@apache-mynewt-core/compiler/arm-none-eabi-m4
>>>>>> @apache-mynewt-core/hw/cmsis-core @apache-mynewt-core/hw/hal
>>>>>> @apache-mynewt-core/hw/mcu/nordic] * @apache-mynewt-core/kernel/os -->
>>>>>> [@apache-mynewt-core/sys/console/full(api:console)
>>>>>> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/util/mem] *
>>>>>> @apache-mynewt-core/libc/baselibc --> [@apache-mynewt-core/kernel/os
>>>>>> @apache-mynewt-core/sys/console/full(api:console)] *
>>>>>> @apache-mynewt-core/sys/console/full -->
>>>>>> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal
>>>>>> @apache-mynewt-core/kernel/os] * @apache-mynewt-core/sys/defs --> [] *
>>>>>> @apache-mynewt-core/sys/flash_map --> [@apache-mynewt-core/sys/defs
>>>>>> @apache-mynewt-core/sys/mfg] * @apache-mynewt-core/sys/log/full -->
>>>>>> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map
>>>>>> @apache-mynewt-core/util/cbmem] * @apache-mynewt-core/sys/mfg -->
>>>>>> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map] *
>>>>>> @apache-mynewt-core/sys/shell --> [@apache-mynewt-core/encoding/base64
>>>>>> @apache-mynewt-core/kernel/os
>>>>>> @apache-mynewt-core/sys/console/full(api:console)
>>>>>> @apache-mynewt-core/time/datetime @apache-mynewt-core/util/crc] *
>>>>>> @apache-mynewt-core/sys/stats/full --> [@apache-mynewt-core/kernel/os] *
>>>>>> @apache-mynewt-core/sys/sysinit --> [@apache-mynewt-core/kernel/os
>>>>>> @apache-mynewt-core/sys/flash_map] * @apache-mynewt-core/time/datetime
>>>>>> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/util/cbmem -->
>>>>>> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os] *
>>>>>> @apache-mynewt-core/util/crc --> [] * @apache-mynewt-core/util/mem -->
>>>>>> [@apache-mynewt-core/kernel/os] * apps/blinky -->
>>>>>> [@apache-mynewt-core/fs/fs @apache-mynewt-core/hw/hal
>>>>>> @apache-mynewt-core/kernel/os @apache-mynewt-core/sys/console/full
>>>>>> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/shell
>>>>>> @apache-mynewt-core/sys/stats/full] * targets/blink_nordic --> []
>>>>>>
>>>>>> newt target revdep blink_nordic Reverse dependency graph (dependee <--
>>>>>> [dependers]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 <--
>>>>>> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>>>>>> @apache-mynewt-core/encoding/base64 <-- [@apache-mynewt-core/sys/shell]
>>>>>> * @apache-mynewt-core/fs/disk <-- [@apache-mynewt-core/fs/fs] *
>>>>>> @apache-mynewt-core/fs/fs <-- [apps/blinky] *
>>>>>> @apache-mynewt-core/hw/cmsis-core <-- [@apache-mynewt-core/hw/mcu/nordic
>>>>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>>>>>> @apache-mynewt-core/hw/drivers/uart <--
>>>>>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
>>>>>> @apache-mynewt-core/sys/console/full] *
>>>>>> @apache-mynewt-core/hw/drivers/uart/uart_hal <--
>>>>>> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/hw/hal <--
>>>>>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
>>>>>> @apache-mynewt-core/hw/mcu/nordic
>>>>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>>>>>> @apache-mynewt-core/sys/console/full @apache-mynewt-core/util/cbmem
>>>>>> apps/blinky] * @apache-mynewt-core/hw/mcu/nordic <--
>>>>>> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>>>>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx <--
>>>>>> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/kernel/os <--
>>>>>> [@apache-mynewt-core/fs/disk @apache-mynewt-core/hw/hal
>>>>>> @apache-mynewt-core/libc/baselibc @apache-mynewt-core/sys/console/full
>>>>>> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/mfg
>>>>>> @apache-mynewt-core/sys/shell @apache-mynewt-core/sys/stats/full
>>>>>> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/time/datetime
>>>>>> @apache-mynewt-core/util/cbmem @apache-mynewt-core/util/mem apps/blinky]
>>>>>> * @apache-mynewt-core/libc/baselibc <--
>>>>>> [@apache-mynewt-core/hw/bsp/nrf52dk] *
>>>>>> @apache-mynewt-core/sys/console/full <--
>>>>>> [@apache-mynewt-core/kernel/os(api:console)
>>>>>> @apache-mynewt-core/libc/baselibc(api:console)
>>>>>> @apache-mynewt-core/sys/shell(api:console) apps/blinky] *
>>>>>> @apache-mynewt-core/sys/defs <-- [@apache-mynewt-core/sys/flash_map] *
>>>>>> @apache-mynewt-core/sys/flash_map <-- [@apache-mynewt-core/sys/log/full
>>>>>> @apache-mynewt-core/sys/mfg @apache-mynewt-core/sys/sysinit] *
>>>>>> @apache-mynewt-core/sys/log/full <-- [apps/blinky] *
>>>>>> @apache-mynewt-core/sys/mfg <-- [@apache-mynewt-core/sys/flash_map] *
>>>>>> @apache-mynewt-core/sys/shell <-- [apps/blinky] *
>>>>>> @apache-mynewt-core/sys/stats/full <-- [apps/blinky] *
>>>>>> @apache-mynewt-core/sys/sysinit <-- [@apache-mynewt-core/kernel/os] *
>>>>>> @apache-mynewt-core/time/datetime <-- [@apache-mynewt-core/sys/shell] *
>>>>>> @apache-mynewt-core/util/cbmem <-- [@apache-mynewt-core/sys/log/full] *
>>>>>> @apache-mynewt-core/util/crc <-- [@apache-mynewt-core/sys/shell] *
>>>>>> @apache-mynewt-core/util/mem <-- [@apache-mynewt-core/kernel/os]
>>>>>>
>>>>>>
>>>>>> Thank you.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Then Yoong Ze
>>>>>>
>>>>>>
>>>>>> On 10/2/2017 11:42 PM, Fabio Utzig wrote:
>>>>>>> No sure what you mean by "removed this fs part". What FS are you using?
>>>>>>>
>>>>>>> Could you provide the output of "newt target dep" and "newt target
>>>>>>> revdep"?
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Fabio Utzig
>>>>>>>
>>>>>>> On Fri, Feb 10, 2017, at 10:59 AM, then yon wrote:
>>>>>>>> Dear Support,
>>>>>>>>
>>>>>>>> After updated to latest develop version, the fs code doesn't work
>>>>>>>> anymore.
>>>>>>>>
>>>>>>>> It gave me the following error:
>>>>>>>> 4:Unhandled interrupt (2), exception sp 0x200015a0 4: r0:0x000000
>>>>>>>> r1:0x00000000 r2:0x80000000 r3:0xe000ed0x0000cdf r5:0x000168b0
>>>>>>>> 4:ICSR:0x00421802 HFSR:0x0000000 C:0x00000 4:BFAR:0xe000ed38
>>>>>>>> MMFAR:0xe000ed34
>>>>>>>>
>>>>>>>> When i removed this fs part everything work well.
>>>>>>>>
>>>>>>>> Thank you.
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>       Then Yoong Ze
>>>>>>> .
>>>>>>>
>>>>> .
>>>>>
>>> .
>>>
> .
>


Re: file system fs/fs not working after updated to latest myNewt

Posted by Fabio Utzig <ut...@utzig.org>.
The code you pasted works for me. Could you check if leaving nffs
enabled but not calling read_config/write_config still triggers the
exception?

On Tue, Feb 14, 2017, at 08:18 PM, then yon wrote:
> Dear Fabio,
> 
> In the previous working version, i'm only included the followind:
> 
> pkg.deps:
>      - "@apache-mynewt-core/fs/fs"
>      - "@apache-mynewt-core/fs/nffs"
> 
> code:
>     #include "fs/fs.h"
>     #include "fs/fsutil.h"
>     #include "nffs/nffs.h"
> int write_config(void) { int rc; /* Create the parent directory. */ rc = 
> fs_mkdir("/cfg"); os_time_delay(1); if (rc != 0) { return -2; } //END if 
> // Create a file and write four bytes to it. rc = 
> fsutil_write_file("/cfg/config.txt <http://config.txt/>", 
> &system_cfg_desc.data_ch_addr <http://system_cfg_desc.data_ch_addr/>[0], 
> sizeof(SYSTEM_CONFIGURATION_DESC_T)); os_time_delay(1); return rc == 0 ? 
> 0 : -1; } //END write_config int read_config() { uint32_t bytes_read; 
> int rc; /* Read up to 15 bytes from the start of the file. */ rc = 
> fsutil_read_file("/cfg/config.txt <http://config.txt/>", 0, 
> sizeof(system_cfg_desc), &system_cfg_desc.data_ch_addr 
> <http://system_cfg_desc.data_ch_addr/>[0], &bytes_read); 
> os_time_delay(1); return rc == 0 ? 0 : -1; } //END read_config
> 
> 
> Thank you.
> 
> Regards,
> 
> Then Yoong Ze
> 
> 
> On 14/2/2017 11:08 PM, Fabio Utzig wrote:
> > Hi,
> >
> > FAT doesn't format a FS (I didn't enable) so it expects an already
> > formatted FS. FAT is also not appropriate to use with Flash if that's
> > what you're using, because it doesn't have a concept of "erase" and it
> > doesn't do wear leveling. I actualy only tested with MMC!
> >
> > I will do some testing today to try to find what is causing your problem
> > with NFFS (or with no FS enabled).
> >
> > What FS operations are you doing? Are you using any of the fs_* calls?
> > Could you copy/paste some of your FS usage code as a gist (or pastebin,
> > etc)?
> >
> > Cheers,
> > Fabio Utzig
> >
> > On Mon, Feb 13, 2017, at 02:57 AM, then yon wrote:
> >> Dear Fabio,
> >>
> >> The previous working project, i include fs/nffs package; but when i
> >> include on latest mynewt straight away it gave me exception so i
> >> disabled it (it gave me exception even all the filesystem code removed).
> >>
> >> Below is the output with the fs/nffs included.
> >>
> >> newt target dep blink_nordic Dependency graph (depender -->
> >> [dependees]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 --> [] *
> >> @apache-mynewt-core/encoding/base64 --> [] * @apache-mynewt-core/fs/disk
> >> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/fs/fs -->
> >> [@apache-mynewt-core/fs/disk] * @apache-mynewt-core/fs/nffs -->
> >> [@apache-mynewt-core/fs/fs @apache-mynewt-core/hw/hal
> >> @apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map
> >> @apache-mynewt-core/sys/log/full(api:log)
> >> @apache-mynewt-core/sys/stats/full(api:stats)
> >> @apache-mynewt-core/test/testutil @apache-mynewt-core/util/crc] *
> >> @apache-mynewt-core/hw/bsp/nrf52dk -->
> >> [@apache-mynewt-core/hw/drivers/uart/uart_hal
> >> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
> >> @apache-mynewt-core/libc/baselibc] * @apache-mynewt-core/hw/cmsis-core
> >> --> [] * @apache-mynewt-core/hw/drivers/uart --> [] *
> >> @apache-mynewt-core/hw/drivers/uart/uart_hal -->
> >> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal] *
> >> @apache-mynewt-core/hw/hal --> [@apache-mynewt-core/kernel/os] *
> >> @apache-mynewt-core/hw/mcu/nordic --> [@apache-mynewt-core/hw/cmsis-core
> >> @apache-mynewt-core/hw/hal] * @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
> >> --> [@apache-mynewt-core/compiler/arm-none-eabi-m4
> >> @apache-mynewt-core/hw/cmsis-core @apache-mynewt-core/hw/hal
> >> @apache-mynewt-core/hw/mcu/nordic] * @apache-mynewt-core/kernel/os -->
> >> [@apache-mynewt-core/sys/console/full(api:console)
> >> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/util/mem] *
> >> @apache-mynewt-core/libc/baselibc --> [@apache-mynewt-core/kernel/os
> >> @apache-mynewt-core/sys/console/full(api:console)] *
> >> @apache-mynewt-core/sys/console/full -->
> >> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal
> >> @apache-mynewt-core/kernel/os] * @apache-mynewt-core/sys/defs --> [] *
> >> @apache-mynewt-core/sys/flash_map --> [@apache-mynewt-core/sys/defs
> >> @apache-mynewt-core/sys/mfg] * @apache-mynewt-core/sys/log/full -->
> >> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map
> >> @apache-mynewt-core/util/cbmem] * @apache-mynewt-core/sys/mfg -->
> >> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map] *
> >> @apache-mynewt-core/sys/shell --> [@apache-mynewt-core/encoding/base64
> >> @apache-mynewt-core/kernel/os
> >> @apache-mynewt-core/sys/console/full(api:console)
> >> @apache-mynewt-core/time/datetime @apache-mynewt-core/util/crc] *
> >> @apache-mynewt-core/sys/stats/full --> [@apache-mynewt-core/kernel/os] *
> >> @apache-mynewt-core/sys/sysinit --> [@apache-mynewt-core/kernel/os
> >> @apache-mynewt-core/sys/flash_map] * @apache-mynewt-core/test/testutil
> >> --> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os
> >> @apache-mynewt-core/sys/sysinit] * @apache-mynewt-core/time/datetime -->
> >> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/util/cbmem -->
> >> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os] *
> >> @apache-mynewt-core/util/crc --> [] * @apache-mynewt-core/util/mem -->
> >> [@apache-mynewt-core/kernel/os] * apps/blinky -->
> >> [@apache-mynewt-core/fs/fs @apache-mynewt-core/fs/nffs
> >> @apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os
> >> @apache-mynewt-core/sys/console/full @apache-mynewt-core/sys/log/full
> >> @apache-mynewt-core/sys/shell @apache-mynewt-core/sys/stats/full] *
> >> targets/blink_nordic --> []
> >> sensmaster@sensmaster-Inspiron-3542:~/myNewtProject/mynewtresearch/myNewtProj$
> >> newt target revdep blink_nordic Reverse dependency graph (dependee <--
> >> [dependers]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 <--
> >> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
> >> @apache-mynewt-core/encoding/base64 <-- [@apache-mynewt-core/sys/shell]
> >> * @apache-mynewt-core/fs/disk <-- [@apache-mynewt-core/fs/fs] *
> >> @apache-mynewt-core/fs/fs <-- [@apache-mynewt-core/fs/nffs apps/blinky]
> >> * @apache-mynewt-core/fs/nffs <-- [apps/blinky] *
> >> @apache-mynewt-core/hw/cmsis-core <-- [@apache-mynewt-core/hw/mcu/nordic
> >> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
> >> @apache-mynewt-core/hw/drivers/uart <--
> >> [@apache-mynewt-core/hw/drivers/uart/uart_hal
> >> @apache-mynewt-core/sys/console/full] *
> >> @apache-mynewt-core/hw/drivers/uart/uart_hal <--
> >> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/hw/hal <--
> >> [@apache-mynewt-core/fs/nffs
> >> @apache-mynewt-core/hw/drivers/uart/uart_hal
> >> @apache-mynewt-core/hw/mcu/nordic
> >> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
> >> @apache-mynewt-core/sys/console/full @apache-mynewt-core/test/testutil
> >> @apache-mynewt-core/util/cbmem apps/blinky] *
> >> @apache-mynewt-core/hw/mcu/nordic <--
> >> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
> >> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx <--
> >> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/kernel/os <--
> >> [@apache-mynewt-core/fs/disk @apache-mynewt-core/fs/nffs
> >> @apache-mynewt-core/hw/hal @apache-mynewt-core/libc/baselibc
> >> @apache-mynewt-core/sys/console/full @apache-mynewt-core/sys/log/full
> >> @apache-mynewt-core/sys/mfg @apache-mynewt-core/sys/shell
> >> @apache-mynewt-core/sys/stats/full @apache-mynewt-core/sys/sysinit
> >> @apache-mynewt-core/test/testutil @apache-mynewt-core/time/datetime
> >> @apache-mynewt-core/util/cbmem @apache-mynewt-core/util/mem apps/blinky]
> >> * @apache-mynewt-core/libc/baselibc <--
> >> [@apache-mynewt-core/hw/bsp/nrf52dk] *
> >> @apache-mynewt-core/sys/console/full <--
> >> [@apache-mynewt-core/kernel/os(api:console)
> >> @apache-mynewt-core/libc/baselibc(api:console)
> >> @apache-mynewt-core/sys/shell(api:console) apps/blinky] *
> >> @apache-mynewt-core/sys/defs <-- [@apache-mynewt-core/sys/flash_map] *
> >> @apache-mynewt-core/sys/flash_map <-- [@apache-mynewt-core/fs/nffs
> >> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/mfg
> >> @apache-mynewt-core/sys/sysinit] * @apache-mynewt-core/sys/log/full <--
> >> [@apache-mynewt-core/fs/nffs(api:log) apps/blinky] *
> >> @apache-mynewt-core/sys/mfg <-- [@apache-mynewt-core/sys/flash_map] *
> >> @apache-mynewt-core/sys/shell <-- [apps/blinky] *
> >> @apache-mynewt-core/sys/stats/full <--
> >> [@apache-mynewt-core/fs/nffs(api:stats) apps/blinky] *
> >> @apache-mynewt-core/sys/sysinit <-- [@apache-mynewt-core/kernel/os
> >> @apache-mynewt-core/test/testutil] * @apache-mynewt-core/test/testutil
> >> <-- [@apache-mynewt-core/fs/nffs] * @apache-mynewt-core/time/datetime
> >> <-- [@apache-mynewt-core/sys/shell] * @apache-mynewt-core/util/cbmem <--
> >> [@apache-mynewt-core/sys/log/full] * @apache-mynewt-core/util/crc <--
> >> [@apache-mynewt-core/fs/nffs @apache-mynewt-core/sys/shell] *
> >> @apache-mynewt-core/util/mem <-- [@apache-mynewt-core/kernel/os]
> >>
> >>
> >> Beside that i tried with fs/fatfs deps, it gave me no exception but the
> >> data doesn't wrote into the filesystem. Do i need to do initialize on
> >> fatfs?
> >>
> >> Thank you.
> >>
> >> Then Yoong Ze
> >>
> >>
> >> On 11/2/2017 12:36 AM, Fabio Utzig wrote:
> >>> Your english is just fine. What surprised me is that you're using the fs
> >>> subsystem without any fs enabled (either having nffs or fatfs or both).
> >>> I was not expecting it, never tried it myself and it might indeed be a
> >>> bug.
> >>>
> >>> Cheers,
> >>> Fabio Utzig
> >>>
> >>> On Fri, Feb 10, 2017, at 02:01 PM, then yon wrote:
> >>>> Dear Fabio,
> >>>>
> >>>> That means i removed all the code related to fs and the package
> >>>> dependencies. Sorry for my bad english.
> >>>>
> >>>> newt target dep blink_nordic
> >>>>
> >>>> Dependency graph (depender --> [dependees]): *
> >>>> @apache-mynewt-core/compiler/arm-none-eabi-m4 --> [] *
> >>>> @apache-mynewt-core/encoding/base64 --> [] * @apache-mynewt-core/fs/disk
> >>>> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/fs/fs -->
> >>>> [@apache-mynewt-core/fs/disk] * @apache-mynewt-core/hw/bsp/nrf52dk -->
> >>>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
> >>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
> >>>> @apache-mynewt-core/libc/baselibc] * @apache-mynewt-core/hw/cmsis-core
> >>>> --> [] * @apache-mynewt-core/hw/drivers/uart --> [] *
> >>>> @apache-mynewt-core/hw/drivers/uart/uart_hal -->
> >>>> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal] *
> >>>> @apache-mynewt-core/hw/hal --> [@apache-mynewt-core/kernel/os] *
> >>>> @apache-mynewt-core/hw/mcu/nordic --> [@apache-mynewt-core/hw/cmsis-core
> >>>> @apache-mynewt-core/hw/hal] * @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
> >>>> --> [@apache-mynewt-core/compiler/arm-none-eabi-m4
> >>>> @apache-mynewt-core/hw/cmsis-core @apache-mynewt-core/hw/hal
> >>>> @apache-mynewt-core/hw/mcu/nordic] * @apache-mynewt-core/kernel/os -->
> >>>> [@apache-mynewt-core/sys/console/full(api:console)
> >>>> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/util/mem] *
> >>>> @apache-mynewt-core/libc/baselibc --> [@apache-mynewt-core/kernel/os
> >>>> @apache-mynewt-core/sys/console/full(api:console)] *
> >>>> @apache-mynewt-core/sys/console/full -->
> >>>> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal
> >>>> @apache-mynewt-core/kernel/os] * @apache-mynewt-core/sys/defs --> [] *
> >>>> @apache-mynewt-core/sys/flash_map --> [@apache-mynewt-core/sys/defs
> >>>> @apache-mynewt-core/sys/mfg] * @apache-mynewt-core/sys/log/full -->
> >>>> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map
> >>>> @apache-mynewt-core/util/cbmem] * @apache-mynewt-core/sys/mfg -->
> >>>> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map] *
> >>>> @apache-mynewt-core/sys/shell --> [@apache-mynewt-core/encoding/base64
> >>>> @apache-mynewt-core/kernel/os
> >>>> @apache-mynewt-core/sys/console/full(api:console)
> >>>> @apache-mynewt-core/time/datetime @apache-mynewt-core/util/crc] *
> >>>> @apache-mynewt-core/sys/stats/full --> [@apache-mynewt-core/kernel/os] *
> >>>> @apache-mynewt-core/sys/sysinit --> [@apache-mynewt-core/kernel/os
> >>>> @apache-mynewt-core/sys/flash_map] * @apache-mynewt-core/time/datetime
> >>>> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/util/cbmem -->
> >>>> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os] *
> >>>> @apache-mynewt-core/util/crc --> [] * @apache-mynewt-core/util/mem -->
> >>>> [@apache-mynewt-core/kernel/os] * apps/blinky -->
> >>>> [@apache-mynewt-core/fs/fs @apache-mynewt-core/hw/hal
> >>>> @apache-mynewt-core/kernel/os @apache-mynewt-core/sys/console/full
> >>>> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/shell
> >>>> @apache-mynewt-core/sys/stats/full] * targets/blink_nordic --> []
> >>>>
> >>>> newt target revdep blink_nordic Reverse dependency graph (dependee <--
> >>>> [dependers]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 <--
> >>>> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
> >>>> @apache-mynewt-core/encoding/base64 <-- [@apache-mynewt-core/sys/shell]
> >>>> * @apache-mynewt-core/fs/disk <-- [@apache-mynewt-core/fs/fs] *
> >>>> @apache-mynewt-core/fs/fs <-- [apps/blinky] *
> >>>> @apache-mynewt-core/hw/cmsis-core <-- [@apache-mynewt-core/hw/mcu/nordic
> >>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
> >>>> @apache-mynewt-core/hw/drivers/uart <--
> >>>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
> >>>> @apache-mynewt-core/sys/console/full] *
> >>>> @apache-mynewt-core/hw/drivers/uart/uart_hal <--
> >>>> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/hw/hal <--
> >>>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
> >>>> @apache-mynewt-core/hw/mcu/nordic
> >>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
> >>>> @apache-mynewt-core/sys/console/full @apache-mynewt-core/util/cbmem
> >>>> apps/blinky] * @apache-mynewt-core/hw/mcu/nordic <--
> >>>> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
> >>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx <--
> >>>> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/kernel/os <--
> >>>> [@apache-mynewt-core/fs/disk @apache-mynewt-core/hw/hal
> >>>> @apache-mynewt-core/libc/baselibc @apache-mynewt-core/sys/console/full
> >>>> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/mfg
> >>>> @apache-mynewt-core/sys/shell @apache-mynewt-core/sys/stats/full
> >>>> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/time/datetime
> >>>> @apache-mynewt-core/util/cbmem @apache-mynewt-core/util/mem apps/blinky]
> >>>> * @apache-mynewt-core/libc/baselibc <--
> >>>> [@apache-mynewt-core/hw/bsp/nrf52dk] *
> >>>> @apache-mynewt-core/sys/console/full <--
> >>>> [@apache-mynewt-core/kernel/os(api:console)
> >>>> @apache-mynewt-core/libc/baselibc(api:console)
> >>>> @apache-mynewt-core/sys/shell(api:console) apps/blinky] *
> >>>> @apache-mynewt-core/sys/defs <-- [@apache-mynewt-core/sys/flash_map] *
> >>>> @apache-mynewt-core/sys/flash_map <-- [@apache-mynewt-core/sys/log/full
> >>>> @apache-mynewt-core/sys/mfg @apache-mynewt-core/sys/sysinit] *
> >>>> @apache-mynewt-core/sys/log/full <-- [apps/blinky] *
> >>>> @apache-mynewt-core/sys/mfg <-- [@apache-mynewt-core/sys/flash_map] *
> >>>> @apache-mynewt-core/sys/shell <-- [apps/blinky] *
> >>>> @apache-mynewt-core/sys/stats/full <-- [apps/blinky] *
> >>>> @apache-mynewt-core/sys/sysinit <-- [@apache-mynewt-core/kernel/os] *
> >>>> @apache-mynewt-core/time/datetime <-- [@apache-mynewt-core/sys/shell] *
> >>>> @apache-mynewt-core/util/cbmem <-- [@apache-mynewt-core/sys/log/full] *
> >>>> @apache-mynewt-core/util/crc <-- [@apache-mynewt-core/sys/shell] *
> >>>> @apache-mynewt-core/util/mem <-- [@apache-mynewt-core/kernel/os]
> >>>>
> >>>>
> >>>> Thank you.
> >>>>
> >>>> Regards,
> >>>>
> >>>> Then Yoong Ze
> >>>>
> >>>>
> >>>> On 10/2/2017 11:42 PM, Fabio Utzig wrote:
> >>>>> No sure what you mean by "removed this fs part". What FS are you using?
> >>>>>
> >>>>> Could you provide the output of "newt target dep" and "newt target
> >>>>> revdep"?
> >>>>>
> >>>>> Cheers,
> >>>>> Fabio Utzig
> >>>>>
> >>>>> On Fri, Feb 10, 2017, at 10:59 AM, then yon wrote:
> >>>>>> Dear Support,
> >>>>>>
> >>>>>> After updated to latest develop version, the fs code doesn't work
> >>>>>> anymore.
> >>>>>>
> >>>>>> It gave me the following error:
> >>>>>> 4:Unhandled interrupt (2), exception sp 0x200015a0 4: r0:0x000000
> >>>>>> r1:0x00000000 r2:0x80000000 r3:0xe000ed0x0000cdf r5:0x000168b0
> >>>>>> 4:ICSR:0x00421802 HFSR:0x0000000 C:0x00000 4:BFAR:0xe000ed38
> >>>>>> MMFAR:0xe000ed34
> >>>>>>
> >>>>>> When i removed this fs part everything work well.
> >>>>>>
> >>>>>> Thank you.
> >>>>>>
> >>>>>> Regards,
> >>>>>>      Then Yoong Ze
> >>>>> .
> >>>>>
> >>> .
> >>>
> > .
> >
> 

Re: file system fs/fs not working after updated to latest myNewt

Posted by then yon <yz...@free2move.se>.
Dear Fabio,

In the previous working version, i'm only included the followind:

pkg.deps:
     - "@apache-mynewt-core/fs/fs"
     - "@apache-mynewt-core/fs/nffs"

code:
    #include "fs/fs.h"
    #include "fs/fsutil.h"
    #include "nffs/nffs.h"
int write_config(void) { int rc; /* Create the parent directory. */ rc = 
fs_mkdir("/cfg"); os_time_delay(1); if (rc != 0) { return -2; } //END if 
// Create a file and write four bytes to it. rc = 
fsutil_write_file("/cfg/config.txt <http://config.txt/>", 
&system_cfg_desc.data_ch_addr <http://system_cfg_desc.data_ch_addr/>[0], 
sizeof(SYSTEM_CONFIGURATION_DESC_T)); os_time_delay(1); return rc == 0 ? 
0 : -1; } //END write_config int read_config() { uint32_t bytes_read; 
int rc; /* Read up to 15 bytes from the start of the file. */ rc = 
fsutil_read_file("/cfg/config.txt <http://config.txt/>", 0, 
sizeof(system_cfg_desc), &system_cfg_desc.data_ch_addr 
<http://system_cfg_desc.data_ch_addr/>[0], &bytes_read); 
os_time_delay(1); return rc == 0 ? 0 : -1; } //END read_config


Thank you.

Regards,

Then Yoong Ze


On 14/2/2017 11:08 PM, Fabio Utzig wrote:
> Hi,
>
> FAT doesn't format a FS (I didn't enable) so it expects an already
> formatted FS. FAT is also not appropriate to use with Flash if that's
> what you're using, because it doesn't have a concept of "erase" and it
> doesn't do wear leveling. I actualy only tested with MMC!
>
> I will do some testing today to try to find what is causing your problem
> with NFFS (or with no FS enabled).
>
> What FS operations are you doing? Are you using any of the fs_* calls?
> Could you copy/paste some of your FS usage code as a gist (or pastebin,
> etc)?
>
> Cheers,
> Fabio Utzig
>
> On Mon, Feb 13, 2017, at 02:57 AM, then yon wrote:
>> Dear Fabio,
>>
>> The previous working project, i include fs/nffs package; but when i
>> include on latest mynewt straight away it gave me exception so i
>> disabled it (it gave me exception even all the filesystem code removed).
>>
>> Below is the output with the fs/nffs included.
>>
>> newt target dep blink_nordic Dependency graph (depender -->
>> [dependees]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 --> [] *
>> @apache-mynewt-core/encoding/base64 --> [] * @apache-mynewt-core/fs/disk
>> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/fs/fs -->
>> [@apache-mynewt-core/fs/disk] * @apache-mynewt-core/fs/nffs -->
>> [@apache-mynewt-core/fs/fs @apache-mynewt-core/hw/hal
>> @apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map
>> @apache-mynewt-core/sys/log/full(api:log)
>> @apache-mynewt-core/sys/stats/full(api:stats)
>> @apache-mynewt-core/test/testutil @apache-mynewt-core/util/crc] *
>> @apache-mynewt-core/hw/bsp/nrf52dk -->
>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>> @apache-mynewt-core/libc/baselibc] * @apache-mynewt-core/hw/cmsis-core
>> --> [] * @apache-mynewt-core/hw/drivers/uart --> [] *
>> @apache-mynewt-core/hw/drivers/uart/uart_hal -->
>> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal] *
>> @apache-mynewt-core/hw/hal --> [@apache-mynewt-core/kernel/os] *
>> @apache-mynewt-core/hw/mcu/nordic --> [@apache-mynewt-core/hw/cmsis-core
>> @apache-mynewt-core/hw/hal] * @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>> --> [@apache-mynewt-core/compiler/arm-none-eabi-m4
>> @apache-mynewt-core/hw/cmsis-core @apache-mynewt-core/hw/hal
>> @apache-mynewt-core/hw/mcu/nordic] * @apache-mynewt-core/kernel/os -->
>> [@apache-mynewt-core/sys/console/full(api:console)
>> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/util/mem] *
>> @apache-mynewt-core/libc/baselibc --> [@apache-mynewt-core/kernel/os
>> @apache-mynewt-core/sys/console/full(api:console)] *
>> @apache-mynewt-core/sys/console/full -->
>> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal
>> @apache-mynewt-core/kernel/os] * @apache-mynewt-core/sys/defs --> [] *
>> @apache-mynewt-core/sys/flash_map --> [@apache-mynewt-core/sys/defs
>> @apache-mynewt-core/sys/mfg] * @apache-mynewt-core/sys/log/full -->
>> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map
>> @apache-mynewt-core/util/cbmem] * @apache-mynewt-core/sys/mfg -->
>> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map] *
>> @apache-mynewt-core/sys/shell --> [@apache-mynewt-core/encoding/base64
>> @apache-mynewt-core/kernel/os
>> @apache-mynewt-core/sys/console/full(api:console)
>> @apache-mynewt-core/time/datetime @apache-mynewt-core/util/crc] *
>> @apache-mynewt-core/sys/stats/full --> [@apache-mynewt-core/kernel/os] *
>> @apache-mynewt-core/sys/sysinit --> [@apache-mynewt-core/kernel/os
>> @apache-mynewt-core/sys/flash_map] * @apache-mynewt-core/test/testutil
>> --> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os
>> @apache-mynewt-core/sys/sysinit] * @apache-mynewt-core/time/datetime -->
>> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/util/cbmem -->
>> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os] *
>> @apache-mynewt-core/util/crc --> [] * @apache-mynewt-core/util/mem -->
>> [@apache-mynewt-core/kernel/os] * apps/blinky -->
>> [@apache-mynewt-core/fs/fs @apache-mynewt-core/fs/nffs
>> @apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os
>> @apache-mynewt-core/sys/console/full @apache-mynewt-core/sys/log/full
>> @apache-mynewt-core/sys/shell @apache-mynewt-core/sys/stats/full] *
>> targets/blink_nordic --> []
>> sensmaster@sensmaster-Inspiron-3542:~/myNewtProject/mynewtresearch/myNewtProj$
>> newt target revdep blink_nordic Reverse dependency graph (dependee <--
>> [dependers]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 <--
>> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>> @apache-mynewt-core/encoding/base64 <-- [@apache-mynewt-core/sys/shell]
>> * @apache-mynewt-core/fs/disk <-- [@apache-mynewt-core/fs/fs] *
>> @apache-mynewt-core/fs/fs <-- [@apache-mynewt-core/fs/nffs apps/blinky]
>> * @apache-mynewt-core/fs/nffs <-- [apps/blinky] *
>> @apache-mynewt-core/hw/cmsis-core <-- [@apache-mynewt-core/hw/mcu/nordic
>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>> @apache-mynewt-core/hw/drivers/uart <--
>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
>> @apache-mynewt-core/sys/console/full] *
>> @apache-mynewt-core/hw/drivers/uart/uart_hal <--
>> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/hw/hal <--
>> [@apache-mynewt-core/fs/nffs
>> @apache-mynewt-core/hw/drivers/uart/uart_hal
>> @apache-mynewt-core/hw/mcu/nordic
>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>> @apache-mynewt-core/sys/console/full @apache-mynewt-core/test/testutil
>> @apache-mynewt-core/util/cbmem apps/blinky] *
>> @apache-mynewt-core/hw/mcu/nordic <--
>> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx <--
>> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/kernel/os <--
>> [@apache-mynewt-core/fs/disk @apache-mynewt-core/fs/nffs
>> @apache-mynewt-core/hw/hal @apache-mynewt-core/libc/baselibc
>> @apache-mynewt-core/sys/console/full @apache-mynewt-core/sys/log/full
>> @apache-mynewt-core/sys/mfg @apache-mynewt-core/sys/shell
>> @apache-mynewt-core/sys/stats/full @apache-mynewt-core/sys/sysinit
>> @apache-mynewt-core/test/testutil @apache-mynewt-core/time/datetime
>> @apache-mynewt-core/util/cbmem @apache-mynewt-core/util/mem apps/blinky]
>> * @apache-mynewt-core/libc/baselibc <--
>> [@apache-mynewt-core/hw/bsp/nrf52dk] *
>> @apache-mynewt-core/sys/console/full <--
>> [@apache-mynewt-core/kernel/os(api:console)
>> @apache-mynewt-core/libc/baselibc(api:console)
>> @apache-mynewt-core/sys/shell(api:console) apps/blinky] *
>> @apache-mynewt-core/sys/defs <-- [@apache-mynewt-core/sys/flash_map] *
>> @apache-mynewt-core/sys/flash_map <-- [@apache-mynewt-core/fs/nffs
>> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/mfg
>> @apache-mynewt-core/sys/sysinit] * @apache-mynewt-core/sys/log/full <--
>> [@apache-mynewt-core/fs/nffs(api:log) apps/blinky] *
>> @apache-mynewt-core/sys/mfg <-- [@apache-mynewt-core/sys/flash_map] *
>> @apache-mynewt-core/sys/shell <-- [apps/blinky] *
>> @apache-mynewt-core/sys/stats/full <--
>> [@apache-mynewt-core/fs/nffs(api:stats) apps/blinky] *
>> @apache-mynewt-core/sys/sysinit <-- [@apache-mynewt-core/kernel/os
>> @apache-mynewt-core/test/testutil] * @apache-mynewt-core/test/testutil
>> <-- [@apache-mynewt-core/fs/nffs] * @apache-mynewt-core/time/datetime
>> <-- [@apache-mynewt-core/sys/shell] * @apache-mynewt-core/util/cbmem <--
>> [@apache-mynewt-core/sys/log/full] * @apache-mynewt-core/util/crc <--
>> [@apache-mynewt-core/fs/nffs @apache-mynewt-core/sys/shell] *
>> @apache-mynewt-core/util/mem <-- [@apache-mynewt-core/kernel/os]
>>
>>
>> Beside that i tried with fs/fatfs deps, it gave me no exception but the
>> data doesn't wrote into the filesystem. Do i need to do initialize on
>> fatfs?
>>
>> Thank you.
>>
>> Then Yoong Ze
>>
>>
>> On 11/2/2017 12:36 AM, Fabio Utzig wrote:
>>> Your english is just fine. What surprised me is that you're using the fs
>>> subsystem without any fs enabled (either having nffs or fatfs or both).
>>> I was not expecting it, never tried it myself and it might indeed be a
>>> bug.
>>>
>>> Cheers,
>>> Fabio Utzig
>>>
>>> On Fri, Feb 10, 2017, at 02:01 PM, then yon wrote:
>>>> Dear Fabio,
>>>>
>>>> That means i removed all the code related to fs and the package
>>>> dependencies. Sorry for my bad english.
>>>>
>>>> newt target dep blink_nordic
>>>>
>>>> Dependency graph (depender --> [dependees]): *
>>>> @apache-mynewt-core/compiler/arm-none-eabi-m4 --> [] *
>>>> @apache-mynewt-core/encoding/base64 --> [] * @apache-mynewt-core/fs/disk
>>>> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/fs/fs -->
>>>> [@apache-mynewt-core/fs/disk] * @apache-mynewt-core/hw/bsp/nrf52dk -->
>>>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
>>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>>>> @apache-mynewt-core/libc/baselibc] * @apache-mynewt-core/hw/cmsis-core
>>>> --> [] * @apache-mynewt-core/hw/drivers/uart --> [] *
>>>> @apache-mynewt-core/hw/drivers/uart/uart_hal -->
>>>> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal] *
>>>> @apache-mynewt-core/hw/hal --> [@apache-mynewt-core/kernel/os] *
>>>> @apache-mynewt-core/hw/mcu/nordic --> [@apache-mynewt-core/hw/cmsis-core
>>>> @apache-mynewt-core/hw/hal] * @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>>>> --> [@apache-mynewt-core/compiler/arm-none-eabi-m4
>>>> @apache-mynewt-core/hw/cmsis-core @apache-mynewt-core/hw/hal
>>>> @apache-mynewt-core/hw/mcu/nordic] * @apache-mynewt-core/kernel/os -->
>>>> [@apache-mynewt-core/sys/console/full(api:console)
>>>> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/util/mem] *
>>>> @apache-mynewt-core/libc/baselibc --> [@apache-mynewt-core/kernel/os
>>>> @apache-mynewt-core/sys/console/full(api:console)] *
>>>> @apache-mynewt-core/sys/console/full -->
>>>> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal
>>>> @apache-mynewt-core/kernel/os] * @apache-mynewt-core/sys/defs --> [] *
>>>> @apache-mynewt-core/sys/flash_map --> [@apache-mynewt-core/sys/defs
>>>> @apache-mynewt-core/sys/mfg] * @apache-mynewt-core/sys/log/full -->
>>>> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map
>>>> @apache-mynewt-core/util/cbmem] * @apache-mynewt-core/sys/mfg -->
>>>> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map] *
>>>> @apache-mynewt-core/sys/shell --> [@apache-mynewt-core/encoding/base64
>>>> @apache-mynewt-core/kernel/os
>>>> @apache-mynewt-core/sys/console/full(api:console)
>>>> @apache-mynewt-core/time/datetime @apache-mynewt-core/util/crc] *
>>>> @apache-mynewt-core/sys/stats/full --> [@apache-mynewt-core/kernel/os] *
>>>> @apache-mynewt-core/sys/sysinit --> [@apache-mynewt-core/kernel/os
>>>> @apache-mynewt-core/sys/flash_map] * @apache-mynewt-core/time/datetime
>>>> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/util/cbmem -->
>>>> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os] *
>>>> @apache-mynewt-core/util/crc --> [] * @apache-mynewt-core/util/mem -->
>>>> [@apache-mynewt-core/kernel/os] * apps/blinky -->
>>>> [@apache-mynewt-core/fs/fs @apache-mynewt-core/hw/hal
>>>> @apache-mynewt-core/kernel/os @apache-mynewt-core/sys/console/full
>>>> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/shell
>>>> @apache-mynewt-core/sys/stats/full] * targets/blink_nordic --> []
>>>>
>>>> newt target revdep blink_nordic Reverse dependency graph (dependee <--
>>>> [dependers]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 <--
>>>> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>>>> @apache-mynewt-core/encoding/base64 <-- [@apache-mynewt-core/sys/shell]
>>>> * @apache-mynewt-core/fs/disk <-- [@apache-mynewt-core/fs/fs] *
>>>> @apache-mynewt-core/fs/fs <-- [apps/blinky] *
>>>> @apache-mynewt-core/hw/cmsis-core <-- [@apache-mynewt-core/hw/mcu/nordic
>>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>>>> @apache-mynewt-core/hw/drivers/uart <--
>>>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
>>>> @apache-mynewt-core/sys/console/full] *
>>>> @apache-mynewt-core/hw/drivers/uart/uart_hal <--
>>>> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/hw/hal <--
>>>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
>>>> @apache-mynewt-core/hw/mcu/nordic
>>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>>>> @apache-mynewt-core/sys/console/full @apache-mynewt-core/util/cbmem
>>>> apps/blinky] * @apache-mynewt-core/hw/mcu/nordic <--
>>>> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>>>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx <--
>>>> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/kernel/os <--
>>>> [@apache-mynewt-core/fs/disk @apache-mynewt-core/hw/hal
>>>> @apache-mynewt-core/libc/baselibc @apache-mynewt-core/sys/console/full
>>>> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/mfg
>>>> @apache-mynewt-core/sys/shell @apache-mynewt-core/sys/stats/full
>>>> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/time/datetime
>>>> @apache-mynewt-core/util/cbmem @apache-mynewt-core/util/mem apps/blinky]
>>>> * @apache-mynewt-core/libc/baselibc <--
>>>> [@apache-mynewt-core/hw/bsp/nrf52dk] *
>>>> @apache-mynewt-core/sys/console/full <--
>>>> [@apache-mynewt-core/kernel/os(api:console)
>>>> @apache-mynewt-core/libc/baselibc(api:console)
>>>> @apache-mynewt-core/sys/shell(api:console) apps/blinky] *
>>>> @apache-mynewt-core/sys/defs <-- [@apache-mynewt-core/sys/flash_map] *
>>>> @apache-mynewt-core/sys/flash_map <-- [@apache-mynewt-core/sys/log/full
>>>> @apache-mynewt-core/sys/mfg @apache-mynewt-core/sys/sysinit] *
>>>> @apache-mynewt-core/sys/log/full <-- [apps/blinky] *
>>>> @apache-mynewt-core/sys/mfg <-- [@apache-mynewt-core/sys/flash_map] *
>>>> @apache-mynewt-core/sys/shell <-- [apps/blinky] *
>>>> @apache-mynewt-core/sys/stats/full <-- [apps/blinky] *
>>>> @apache-mynewt-core/sys/sysinit <-- [@apache-mynewt-core/kernel/os] *
>>>> @apache-mynewt-core/time/datetime <-- [@apache-mynewt-core/sys/shell] *
>>>> @apache-mynewt-core/util/cbmem <-- [@apache-mynewt-core/sys/log/full] *
>>>> @apache-mynewt-core/util/crc <-- [@apache-mynewt-core/sys/shell] *
>>>> @apache-mynewt-core/util/mem <-- [@apache-mynewt-core/kernel/os]
>>>>
>>>>
>>>> Thank you.
>>>>
>>>> Regards,
>>>>
>>>> Then Yoong Ze
>>>>
>>>>
>>>> On 10/2/2017 11:42 PM, Fabio Utzig wrote:
>>>>> No sure what you mean by "removed this fs part". What FS are you using?
>>>>>
>>>>> Could you provide the output of "newt target dep" and "newt target
>>>>> revdep"?
>>>>>
>>>>> Cheers,
>>>>> Fabio Utzig
>>>>>
>>>>> On Fri, Feb 10, 2017, at 10:59 AM, then yon wrote:
>>>>>> Dear Support,
>>>>>>
>>>>>> After updated to latest develop version, the fs code doesn't work
>>>>>> anymore.
>>>>>>
>>>>>> It gave me the following error:
>>>>>> 4:Unhandled interrupt (2), exception sp 0x200015a0 4: r0:0x000000
>>>>>> r1:0x00000000 r2:0x80000000 r3:0xe000ed0x0000cdf r5:0x000168b0
>>>>>> 4:ICSR:0x00421802 HFSR:0x0000000 C:0x00000 4:BFAR:0xe000ed38
>>>>>> MMFAR:0xe000ed34
>>>>>>
>>>>>> When i removed this fs part everything work well.
>>>>>>
>>>>>> Thank you.
>>>>>>
>>>>>> Regards,
>>>>>>      Then Yoong Ze
>>>>> .
>>>>>
>>> .
>>>
> .
>


Re: file system fs/fs not working after updated to latest myNewt

Posted by Fabio Utzig <ut...@utzig.org>.
Hi,

FAT doesn't format a FS (I didn't enable) so it expects an already
formatted FS. FAT is also not appropriate to use with Flash if that's
what you're using, because it doesn't have a concept of "erase" and it
doesn't do wear leveling. I actualy only tested with MMC!

I will do some testing today to try to find what is causing your problem
with NFFS (or with no FS enabled).

What FS operations are you doing? Are you using any of the fs_* calls?
Could you copy/paste some of your FS usage code as a gist (or pastebin,
etc)?

Cheers,
Fabio Utzig

On Mon, Feb 13, 2017, at 02:57 AM, then yon wrote:
> Dear Fabio,
> 
> The previous working project, i include fs/nffs package; but when i 
> include on latest mynewt straight away it gave me exception so i 
> disabled it (it gave me exception even all the filesystem code removed).
> 
> Below is the output with the fs/nffs included.
> 
> newt target dep blink_nordic Dependency graph (depender --> 
> [dependees]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 --> [] * 
> @apache-mynewt-core/encoding/base64 --> [] * @apache-mynewt-core/fs/disk 
> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/fs/fs --> 
> [@apache-mynewt-core/fs/disk] * @apache-mynewt-core/fs/nffs --> 
> [@apache-mynewt-core/fs/fs @apache-mynewt-core/hw/hal 
> @apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map 
> @apache-mynewt-core/sys/log/full(api:log) 
> @apache-mynewt-core/sys/stats/full(api:stats) 
> @apache-mynewt-core/test/testutil @apache-mynewt-core/util/crc] * 
> @apache-mynewt-core/hw/bsp/nrf52dk --> 
> [@apache-mynewt-core/hw/drivers/uart/uart_hal 
> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx 
> @apache-mynewt-core/libc/baselibc] * @apache-mynewt-core/hw/cmsis-core 
> --> [] * @apache-mynewt-core/hw/drivers/uart --> [] * 
> @apache-mynewt-core/hw/drivers/uart/uart_hal --> 
> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal] * 
> @apache-mynewt-core/hw/hal --> [@apache-mynewt-core/kernel/os] * 
> @apache-mynewt-core/hw/mcu/nordic --> [@apache-mynewt-core/hw/cmsis-core 
> @apache-mynewt-core/hw/hal] * @apache-mynewt-core/hw/mcu/nordic/nrf52xxx 
> --> [@apache-mynewt-core/compiler/arm-none-eabi-m4 
> @apache-mynewt-core/hw/cmsis-core @apache-mynewt-core/hw/hal 
> @apache-mynewt-core/hw/mcu/nordic] * @apache-mynewt-core/kernel/os --> 
> [@apache-mynewt-core/sys/console/full(api:console) 
> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/util/mem] * 
> @apache-mynewt-core/libc/baselibc --> [@apache-mynewt-core/kernel/os 
> @apache-mynewt-core/sys/console/full(api:console)] * 
> @apache-mynewt-core/sys/console/full --> 
> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal 
> @apache-mynewt-core/kernel/os] * @apache-mynewt-core/sys/defs --> [] * 
> @apache-mynewt-core/sys/flash_map --> [@apache-mynewt-core/sys/defs 
> @apache-mynewt-core/sys/mfg] * @apache-mynewt-core/sys/log/full --> 
> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map 
> @apache-mynewt-core/util/cbmem] * @apache-mynewt-core/sys/mfg --> 
> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map] * 
> @apache-mynewt-core/sys/shell --> [@apache-mynewt-core/encoding/base64 
> @apache-mynewt-core/kernel/os 
> @apache-mynewt-core/sys/console/full(api:console) 
> @apache-mynewt-core/time/datetime @apache-mynewt-core/util/crc] * 
> @apache-mynewt-core/sys/stats/full --> [@apache-mynewt-core/kernel/os] * 
> @apache-mynewt-core/sys/sysinit --> [@apache-mynewt-core/kernel/os 
> @apache-mynewt-core/sys/flash_map] * @apache-mynewt-core/test/testutil 
> --> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os 
> @apache-mynewt-core/sys/sysinit] * @apache-mynewt-core/time/datetime --> 
> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/util/cbmem --> 
> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os] * 
> @apache-mynewt-core/util/crc --> [] * @apache-mynewt-core/util/mem --> 
> [@apache-mynewt-core/kernel/os] * apps/blinky --> 
> [@apache-mynewt-core/fs/fs @apache-mynewt-core/fs/nffs 
> @apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os 
> @apache-mynewt-core/sys/console/full @apache-mynewt-core/sys/log/full 
> @apache-mynewt-core/sys/shell @apache-mynewt-core/sys/stats/full] * 
> targets/blink_nordic --> [] 
> sensmaster@sensmaster-Inspiron-3542:~/myNewtProject/mynewtresearch/myNewtProj$ 
> newt target revdep blink_nordic Reverse dependency graph (dependee <-- 
> [dependers]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 <-- 
> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] * 
> @apache-mynewt-core/encoding/base64 <-- [@apache-mynewt-core/sys/shell] 
> * @apache-mynewt-core/fs/disk <-- [@apache-mynewt-core/fs/fs] * 
> @apache-mynewt-core/fs/fs <-- [@apache-mynewt-core/fs/nffs apps/blinky] 
> * @apache-mynewt-core/fs/nffs <-- [apps/blinky] * 
> @apache-mynewt-core/hw/cmsis-core <-- [@apache-mynewt-core/hw/mcu/nordic 
> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx] * 
> @apache-mynewt-core/hw/drivers/uart <-- 
> [@apache-mynewt-core/hw/drivers/uart/uart_hal 
> @apache-mynewt-core/sys/console/full] * 
> @apache-mynewt-core/hw/drivers/uart/uart_hal <-- 
> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/hw/hal <-- 
> [@apache-mynewt-core/fs/nffs 
> @apache-mynewt-core/hw/drivers/uart/uart_hal 
> @apache-mynewt-core/hw/mcu/nordic 
> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx 
> @apache-mynewt-core/sys/console/full @apache-mynewt-core/test/testutil 
> @apache-mynewt-core/util/cbmem apps/blinky] * 
> @apache-mynewt-core/hw/mcu/nordic <-- 
> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] * 
> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx <-- 
> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/kernel/os <-- 
> [@apache-mynewt-core/fs/disk @apache-mynewt-core/fs/nffs 
> @apache-mynewt-core/hw/hal @apache-mynewt-core/libc/baselibc 
> @apache-mynewt-core/sys/console/full @apache-mynewt-core/sys/log/full 
> @apache-mynewt-core/sys/mfg @apache-mynewt-core/sys/shell 
> @apache-mynewt-core/sys/stats/full @apache-mynewt-core/sys/sysinit 
> @apache-mynewt-core/test/testutil @apache-mynewt-core/time/datetime 
> @apache-mynewt-core/util/cbmem @apache-mynewt-core/util/mem apps/blinky] 
> * @apache-mynewt-core/libc/baselibc <-- 
> [@apache-mynewt-core/hw/bsp/nrf52dk] * 
> @apache-mynewt-core/sys/console/full <-- 
> [@apache-mynewt-core/kernel/os(api:console) 
> @apache-mynewt-core/libc/baselibc(api:console) 
> @apache-mynewt-core/sys/shell(api:console) apps/blinky] * 
> @apache-mynewt-core/sys/defs <-- [@apache-mynewt-core/sys/flash_map] * 
> @apache-mynewt-core/sys/flash_map <-- [@apache-mynewt-core/fs/nffs 
> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/mfg 
> @apache-mynewt-core/sys/sysinit] * @apache-mynewt-core/sys/log/full <-- 
> [@apache-mynewt-core/fs/nffs(api:log) apps/blinky] * 
> @apache-mynewt-core/sys/mfg <-- [@apache-mynewt-core/sys/flash_map] * 
> @apache-mynewt-core/sys/shell <-- [apps/blinky] * 
> @apache-mynewt-core/sys/stats/full <-- 
> [@apache-mynewt-core/fs/nffs(api:stats) apps/blinky] * 
> @apache-mynewt-core/sys/sysinit <-- [@apache-mynewt-core/kernel/os 
> @apache-mynewt-core/test/testutil] * @apache-mynewt-core/test/testutil 
> <-- [@apache-mynewt-core/fs/nffs] * @apache-mynewt-core/time/datetime 
> <-- [@apache-mynewt-core/sys/shell] * @apache-mynewt-core/util/cbmem <-- 
> [@apache-mynewt-core/sys/log/full] * @apache-mynewt-core/util/crc <-- 
> [@apache-mynewt-core/fs/nffs @apache-mynewt-core/sys/shell] * 
> @apache-mynewt-core/util/mem <-- [@apache-mynewt-core/kernel/os]
> 
> 
> Beside that i tried with fs/fatfs deps, it gave me no exception but the 
> data doesn't wrote into the filesystem. Do i need to do initialize on
> fatfs?
> 
> Thank you.
> 
> Then Yoong Ze
> 
> 
> On 11/2/2017 12:36 AM, Fabio Utzig wrote:
> > Your english is just fine. What surprised me is that you're using the fs
> > subsystem without any fs enabled (either having nffs or fatfs or both).
> > I was not expecting it, never tried it myself and it might indeed be a
> > bug.
> >
> > Cheers,
> > Fabio Utzig
> >
> > On Fri, Feb 10, 2017, at 02:01 PM, then yon wrote:
> >> Dear Fabio,
> >>
> >> That means i removed all the code related to fs and the package
> >> dependencies. Sorry for my bad english.
> >>
> >> newt target dep blink_nordic
> >>
> >> Dependency graph (depender --> [dependees]): *
> >> @apache-mynewt-core/compiler/arm-none-eabi-m4 --> [] *
> >> @apache-mynewt-core/encoding/base64 --> [] * @apache-mynewt-core/fs/disk
> >> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/fs/fs -->
> >> [@apache-mynewt-core/fs/disk] * @apache-mynewt-core/hw/bsp/nrf52dk -->
> >> [@apache-mynewt-core/hw/drivers/uart/uart_hal
> >> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
> >> @apache-mynewt-core/libc/baselibc] * @apache-mynewt-core/hw/cmsis-core
> >> --> [] * @apache-mynewt-core/hw/drivers/uart --> [] *
> >> @apache-mynewt-core/hw/drivers/uart/uart_hal -->
> >> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal] *
> >> @apache-mynewt-core/hw/hal --> [@apache-mynewt-core/kernel/os] *
> >> @apache-mynewt-core/hw/mcu/nordic --> [@apache-mynewt-core/hw/cmsis-core
> >> @apache-mynewt-core/hw/hal] * @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
> >> --> [@apache-mynewt-core/compiler/arm-none-eabi-m4
> >> @apache-mynewt-core/hw/cmsis-core @apache-mynewt-core/hw/hal
> >> @apache-mynewt-core/hw/mcu/nordic] * @apache-mynewt-core/kernel/os -->
> >> [@apache-mynewt-core/sys/console/full(api:console)
> >> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/util/mem] *
> >> @apache-mynewt-core/libc/baselibc --> [@apache-mynewt-core/kernel/os
> >> @apache-mynewt-core/sys/console/full(api:console)] *
> >> @apache-mynewt-core/sys/console/full -->
> >> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal
> >> @apache-mynewt-core/kernel/os] * @apache-mynewt-core/sys/defs --> [] *
> >> @apache-mynewt-core/sys/flash_map --> [@apache-mynewt-core/sys/defs
> >> @apache-mynewt-core/sys/mfg] * @apache-mynewt-core/sys/log/full -->
> >> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map
> >> @apache-mynewt-core/util/cbmem] * @apache-mynewt-core/sys/mfg -->
> >> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map] *
> >> @apache-mynewt-core/sys/shell --> [@apache-mynewt-core/encoding/base64
> >> @apache-mynewt-core/kernel/os
> >> @apache-mynewt-core/sys/console/full(api:console)
> >> @apache-mynewt-core/time/datetime @apache-mynewt-core/util/crc] *
> >> @apache-mynewt-core/sys/stats/full --> [@apache-mynewt-core/kernel/os] *
> >> @apache-mynewt-core/sys/sysinit --> [@apache-mynewt-core/kernel/os
> >> @apache-mynewt-core/sys/flash_map] * @apache-mynewt-core/time/datetime
> >> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/util/cbmem -->
> >> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os] *
> >> @apache-mynewt-core/util/crc --> [] * @apache-mynewt-core/util/mem -->
> >> [@apache-mynewt-core/kernel/os] * apps/blinky -->
> >> [@apache-mynewt-core/fs/fs @apache-mynewt-core/hw/hal
> >> @apache-mynewt-core/kernel/os @apache-mynewt-core/sys/console/full
> >> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/shell
> >> @apache-mynewt-core/sys/stats/full] * targets/blink_nordic --> []
> >>
> >> newt target revdep blink_nordic Reverse dependency graph (dependee <--
> >> [dependers]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 <--
> >> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
> >> @apache-mynewt-core/encoding/base64 <-- [@apache-mynewt-core/sys/shell]
> >> * @apache-mynewt-core/fs/disk <-- [@apache-mynewt-core/fs/fs] *
> >> @apache-mynewt-core/fs/fs <-- [apps/blinky] *
> >> @apache-mynewt-core/hw/cmsis-core <-- [@apache-mynewt-core/hw/mcu/nordic
> >> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
> >> @apache-mynewt-core/hw/drivers/uart <--
> >> [@apache-mynewt-core/hw/drivers/uart/uart_hal
> >> @apache-mynewt-core/sys/console/full] *
> >> @apache-mynewt-core/hw/drivers/uart/uart_hal <--
> >> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/hw/hal <--
> >> [@apache-mynewt-core/hw/drivers/uart/uart_hal
> >> @apache-mynewt-core/hw/mcu/nordic
> >> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
> >> @apache-mynewt-core/sys/console/full @apache-mynewt-core/util/cbmem
> >> apps/blinky] * @apache-mynewt-core/hw/mcu/nordic <--
> >> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
> >> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx <--
> >> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/kernel/os <--
> >> [@apache-mynewt-core/fs/disk @apache-mynewt-core/hw/hal
> >> @apache-mynewt-core/libc/baselibc @apache-mynewt-core/sys/console/full
> >> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/mfg
> >> @apache-mynewt-core/sys/shell @apache-mynewt-core/sys/stats/full
> >> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/time/datetime
> >> @apache-mynewt-core/util/cbmem @apache-mynewt-core/util/mem apps/blinky]
> >> * @apache-mynewt-core/libc/baselibc <--
> >> [@apache-mynewt-core/hw/bsp/nrf52dk] *
> >> @apache-mynewt-core/sys/console/full <--
> >> [@apache-mynewt-core/kernel/os(api:console)
> >> @apache-mynewt-core/libc/baselibc(api:console)
> >> @apache-mynewt-core/sys/shell(api:console) apps/blinky] *
> >> @apache-mynewt-core/sys/defs <-- [@apache-mynewt-core/sys/flash_map] *
> >> @apache-mynewt-core/sys/flash_map <-- [@apache-mynewt-core/sys/log/full
> >> @apache-mynewt-core/sys/mfg @apache-mynewt-core/sys/sysinit] *
> >> @apache-mynewt-core/sys/log/full <-- [apps/blinky] *
> >> @apache-mynewt-core/sys/mfg <-- [@apache-mynewt-core/sys/flash_map] *
> >> @apache-mynewt-core/sys/shell <-- [apps/blinky] *
> >> @apache-mynewt-core/sys/stats/full <-- [apps/blinky] *
> >> @apache-mynewt-core/sys/sysinit <-- [@apache-mynewt-core/kernel/os] *
> >> @apache-mynewt-core/time/datetime <-- [@apache-mynewt-core/sys/shell] *
> >> @apache-mynewt-core/util/cbmem <-- [@apache-mynewt-core/sys/log/full] *
> >> @apache-mynewt-core/util/crc <-- [@apache-mynewt-core/sys/shell] *
> >> @apache-mynewt-core/util/mem <-- [@apache-mynewt-core/kernel/os]
> >>
> >>
> >> Thank you.
> >>
> >> Regards,
> >>
> >> Then Yoong Ze
> >>
> >>
> >> On 10/2/2017 11:42 PM, Fabio Utzig wrote:
> >>> No sure what you mean by "removed this fs part". What FS are you using?
> >>>
> >>> Could you provide the output of "newt target dep" and "newt target
> >>> revdep"?
> >>>
> >>> Cheers,
> >>> Fabio Utzig
> >>>
> >>> On Fri, Feb 10, 2017, at 10:59 AM, then yon wrote:
> >>>> Dear Support,
> >>>>
> >>>> After updated to latest develop version, the fs code doesn't work
> >>>> anymore.
> >>>>
> >>>> It gave me the following error:
> >>>> 4:Unhandled interrupt (2), exception sp 0x200015a0 4: r0:0x000000
> >>>> r1:0x00000000 r2:0x80000000 r3:0xe000ed0x0000cdf r5:0x000168b0
> >>>> 4:ICSR:0x00421802 HFSR:0x0000000 C:0x00000 4:BFAR:0xe000ed38
> >>>> MMFAR:0xe000ed34
> >>>>
> >>>> When i removed this fs part everything work well.
> >>>>
> >>>> Thank you.
> >>>>
> >>>> Regards,
> >>>>     Then Yoong Ze
> >>> .
> >>>
> > .
> >
> 

Re: file system fs/fs not working after updated to latest myNewt

Posted by then yon <yz...@free2move.se>.
Dear Fabio,

The previous working project, i include fs/nffs package; but when i 
include on latest mynewt straight away it gave me exception so i 
disabled it (it gave me exception even all the filesystem code removed).

Below is the output with the fs/nffs included.

newt target dep blink_nordic Dependency graph (depender --> 
[dependees]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 --> [] * 
@apache-mynewt-core/encoding/base64 --> [] * @apache-mynewt-core/fs/disk 
--> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/fs/fs --> 
[@apache-mynewt-core/fs/disk] * @apache-mynewt-core/fs/nffs --> 
[@apache-mynewt-core/fs/fs @apache-mynewt-core/hw/hal 
@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map 
@apache-mynewt-core/sys/log/full(api:log) 
@apache-mynewt-core/sys/stats/full(api:stats) 
@apache-mynewt-core/test/testutil @apache-mynewt-core/util/crc] * 
@apache-mynewt-core/hw/bsp/nrf52dk --> 
[@apache-mynewt-core/hw/drivers/uart/uart_hal 
@apache-mynewt-core/hw/mcu/nordic/nrf52xxx 
@apache-mynewt-core/libc/baselibc] * @apache-mynewt-core/hw/cmsis-core 
--> [] * @apache-mynewt-core/hw/drivers/uart --> [] * 
@apache-mynewt-core/hw/drivers/uart/uart_hal --> 
[@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal] * 
@apache-mynewt-core/hw/hal --> [@apache-mynewt-core/kernel/os] * 
@apache-mynewt-core/hw/mcu/nordic --> [@apache-mynewt-core/hw/cmsis-core 
@apache-mynewt-core/hw/hal] * @apache-mynewt-core/hw/mcu/nordic/nrf52xxx 
--> [@apache-mynewt-core/compiler/arm-none-eabi-m4 
@apache-mynewt-core/hw/cmsis-core @apache-mynewt-core/hw/hal 
@apache-mynewt-core/hw/mcu/nordic] * @apache-mynewt-core/kernel/os --> 
[@apache-mynewt-core/sys/console/full(api:console) 
@apache-mynewt-core/sys/sysinit @apache-mynewt-core/util/mem] * 
@apache-mynewt-core/libc/baselibc --> [@apache-mynewt-core/kernel/os 
@apache-mynewt-core/sys/console/full(api:console)] * 
@apache-mynewt-core/sys/console/full --> 
[@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal 
@apache-mynewt-core/kernel/os] * @apache-mynewt-core/sys/defs --> [] * 
@apache-mynewt-core/sys/flash_map --> [@apache-mynewt-core/sys/defs 
@apache-mynewt-core/sys/mfg] * @apache-mynewt-core/sys/log/full --> 
[@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map 
@apache-mynewt-core/util/cbmem] * @apache-mynewt-core/sys/mfg --> 
[@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map] * 
@apache-mynewt-core/sys/shell --> [@apache-mynewt-core/encoding/base64 
@apache-mynewt-core/kernel/os 
@apache-mynewt-core/sys/console/full(api:console) 
@apache-mynewt-core/time/datetime @apache-mynewt-core/util/crc] * 
@apache-mynewt-core/sys/stats/full --> [@apache-mynewt-core/kernel/os] * 
@apache-mynewt-core/sys/sysinit --> [@apache-mynewt-core/kernel/os 
@apache-mynewt-core/sys/flash_map] * @apache-mynewt-core/test/testutil 
--> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os 
@apache-mynewt-core/sys/sysinit] * @apache-mynewt-core/time/datetime --> 
[@apache-mynewt-core/kernel/os] * @apache-mynewt-core/util/cbmem --> 
[@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os] * 
@apache-mynewt-core/util/crc --> [] * @apache-mynewt-core/util/mem --> 
[@apache-mynewt-core/kernel/os] * apps/blinky --> 
[@apache-mynewt-core/fs/fs @apache-mynewt-core/fs/nffs 
@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os 
@apache-mynewt-core/sys/console/full @apache-mynewt-core/sys/log/full 
@apache-mynewt-core/sys/shell @apache-mynewt-core/sys/stats/full] * 
targets/blink_nordic --> [] 
sensmaster@sensmaster-Inspiron-3542:~/myNewtProject/mynewtresearch/myNewtProj$ 
newt target revdep blink_nordic Reverse dependency graph (dependee <-- 
[dependers]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 <-- 
[@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] * 
@apache-mynewt-core/encoding/base64 <-- [@apache-mynewt-core/sys/shell] 
* @apache-mynewt-core/fs/disk <-- [@apache-mynewt-core/fs/fs] * 
@apache-mynewt-core/fs/fs <-- [@apache-mynewt-core/fs/nffs apps/blinky] 
* @apache-mynewt-core/fs/nffs <-- [apps/blinky] * 
@apache-mynewt-core/hw/cmsis-core <-- [@apache-mynewt-core/hw/mcu/nordic 
@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] * 
@apache-mynewt-core/hw/drivers/uart <-- 
[@apache-mynewt-core/hw/drivers/uart/uart_hal 
@apache-mynewt-core/sys/console/full] * 
@apache-mynewt-core/hw/drivers/uart/uart_hal <-- 
[@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/hw/hal <-- 
[@apache-mynewt-core/fs/nffs 
@apache-mynewt-core/hw/drivers/uart/uart_hal 
@apache-mynewt-core/hw/mcu/nordic 
@apache-mynewt-core/hw/mcu/nordic/nrf52xxx 
@apache-mynewt-core/sys/console/full @apache-mynewt-core/test/testutil 
@apache-mynewt-core/util/cbmem apps/blinky] * 
@apache-mynewt-core/hw/mcu/nordic <-- 
[@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] * 
@apache-mynewt-core/hw/mcu/nordic/nrf52xxx <-- 
[@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/kernel/os <-- 
[@apache-mynewt-core/fs/disk @apache-mynewt-core/fs/nffs 
@apache-mynewt-core/hw/hal @apache-mynewt-core/libc/baselibc 
@apache-mynewt-core/sys/console/full @apache-mynewt-core/sys/log/full 
@apache-mynewt-core/sys/mfg @apache-mynewt-core/sys/shell 
@apache-mynewt-core/sys/stats/full @apache-mynewt-core/sys/sysinit 
@apache-mynewt-core/test/testutil @apache-mynewt-core/time/datetime 
@apache-mynewt-core/util/cbmem @apache-mynewt-core/util/mem apps/blinky] 
* @apache-mynewt-core/libc/baselibc <-- 
[@apache-mynewt-core/hw/bsp/nrf52dk] * 
@apache-mynewt-core/sys/console/full <-- 
[@apache-mynewt-core/kernel/os(api:console) 
@apache-mynewt-core/libc/baselibc(api:console) 
@apache-mynewt-core/sys/shell(api:console) apps/blinky] * 
@apache-mynewt-core/sys/defs <-- [@apache-mynewt-core/sys/flash_map] * 
@apache-mynewt-core/sys/flash_map <-- [@apache-mynewt-core/fs/nffs 
@apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/mfg 
@apache-mynewt-core/sys/sysinit] * @apache-mynewt-core/sys/log/full <-- 
[@apache-mynewt-core/fs/nffs(api:log) apps/blinky] * 
@apache-mynewt-core/sys/mfg <-- [@apache-mynewt-core/sys/flash_map] * 
@apache-mynewt-core/sys/shell <-- [apps/blinky] * 
@apache-mynewt-core/sys/stats/full <-- 
[@apache-mynewt-core/fs/nffs(api:stats) apps/blinky] * 
@apache-mynewt-core/sys/sysinit <-- [@apache-mynewt-core/kernel/os 
@apache-mynewt-core/test/testutil] * @apache-mynewt-core/test/testutil 
<-- [@apache-mynewt-core/fs/nffs] * @apache-mynewt-core/time/datetime 
<-- [@apache-mynewt-core/sys/shell] * @apache-mynewt-core/util/cbmem <-- 
[@apache-mynewt-core/sys/log/full] * @apache-mynewt-core/util/crc <-- 
[@apache-mynewt-core/fs/nffs @apache-mynewt-core/sys/shell] * 
@apache-mynewt-core/util/mem <-- [@apache-mynewt-core/kernel/os]


Beside that i tried with fs/fatfs deps, it gave me no exception but the 
data doesn't wrote into the filesystem. Do i need to do initialize on fatfs?

Thank you.

Then Yoong Ze


On 11/2/2017 12:36 AM, Fabio Utzig wrote:
> Your english is just fine. What surprised me is that you're using the fs
> subsystem without any fs enabled (either having nffs or fatfs or both).
> I was not expecting it, never tried it myself and it might indeed be a
> bug.
>
> Cheers,
> Fabio Utzig
>
> On Fri, Feb 10, 2017, at 02:01 PM, then yon wrote:
>> Dear Fabio,
>>
>> That means i removed all the code related to fs and the package
>> dependencies. Sorry for my bad english.
>>
>> newt target dep blink_nordic
>>
>> Dependency graph (depender --> [dependees]): *
>> @apache-mynewt-core/compiler/arm-none-eabi-m4 --> [] *
>> @apache-mynewt-core/encoding/base64 --> [] * @apache-mynewt-core/fs/disk
>> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/fs/fs -->
>> [@apache-mynewt-core/fs/disk] * @apache-mynewt-core/hw/bsp/nrf52dk -->
>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>> @apache-mynewt-core/libc/baselibc] * @apache-mynewt-core/hw/cmsis-core
>> --> [] * @apache-mynewt-core/hw/drivers/uart --> [] *
>> @apache-mynewt-core/hw/drivers/uart/uart_hal -->
>> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal] *
>> @apache-mynewt-core/hw/hal --> [@apache-mynewt-core/kernel/os] *
>> @apache-mynewt-core/hw/mcu/nordic --> [@apache-mynewt-core/hw/cmsis-core
>> @apache-mynewt-core/hw/hal] * @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>> --> [@apache-mynewt-core/compiler/arm-none-eabi-m4
>> @apache-mynewt-core/hw/cmsis-core @apache-mynewt-core/hw/hal
>> @apache-mynewt-core/hw/mcu/nordic] * @apache-mynewt-core/kernel/os -->
>> [@apache-mynewt-core/sys/console/full(api:console)
>> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/util/mem] *
>> @apache-mynewt-core/libc/baselibc --> [@apache-mynewt-core/kernel/os
>> @apache-mynewt-core/sys/console/full(api:console)] *
>> @apache-mynewt-core/sys/console/full -->
>> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal
>> @apache-mynewt-core/kernel/os] * @apache-mynewt-core/sys/defs --> [] *
>> @apache-mynewt-core/sys/flash_map --> [@apache-mynewt-core/sys/defs
>> @apache-mynewt-core/sys/mfg] * @apache-mynewt-core/sys/log/full -->
>> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map
>> @apache-mynewt-core/util/cbmem] * @apache-mynewt-core/sys/mfg -->
>> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map] *
>> @apache-mynewt-core/sys/shell --> [@apache-mynewt-core/encoding/base64
>> @apache-mynewt-core/kernel/os
>> @apache-mynewt-core/sys/console/full(api:console)
>> @apache-mynewt-core/time/datetime @apache-mynewt-core/util/crc] *
>> @apache-mynewt-core/sys/stats/full --> [@apache-mynewt-core/kernel/os] *
>> @apache-mynewt-core/sys/sysinit --> [@apache-mynewt-core/kernel/os
>> @apache-mynewt-core/sys/flash_map] * @apache-mynewt-core/time/datetime
>> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/util/cbmem -->
>> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os] *
>> @apache-mynewt-core/util/crc --> [] * @apache-mynewt-core/util/mem -->
>> [@apache-mynewt-core/kernel/os] * apps/blinky -->
>> [@apache-mynewt-core/fs/fs @apache-mynewt-core/hw/hal
>> @apache-mynewt-core/kernel/os @apache-mynewt-core/sys/console/full
>> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/shell
>> @apache-mynewt-core/sys/stats/full] * targets/blink_nordic --> []
>>
>> newt target revdep blink_nordic Reverse dependency graph (dependee <--
>> [dependers]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 <--
>> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>> @apache-mynewt-core/encoding/base64 <-- [@apache-mynewt-core/sys/shell]
>> * @apache-mynewt-core/fs/disk <-- [@apache-mynewt-core/fs/fs] *
>> @apache-mynewt-core/fs/fs <-- [apps/blinky] *
>> @apache-mynewt-core/hw/cmsis-core <-- [@apache-mynewt-core/hw/mcu/nordic
>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>> @apache-mynewt-core/hw/drivers/uart <--
>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
>> @apache-mynewt-core/sys/console/full] *
>> @apache-mynewt-core/hw/drivers/uart/uart_hal <--
>> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/hw/hal <--
>> [@apache-mynewt-core/hw/drivers/uart/uart_hal
>> @apache-mynewt-core/hw/mcu/nordic
>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx
>> @apache-mynewt-core/sys/console/full @apache-mynewt-core/util/cbmem
>> apps/blinky] * @apache-mynewt-core/hw/mcu/nordic <--
>> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] *
>> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx <--
>> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/kernel/os <--
>> [@apache-mynewt-core/fs/disk @apache-mynewt-core/hw/hal
>> @apache-mynewt-core/libc/baselibc @apache-mynewt-core/sys/console/full
>> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/mfg
>> @apache-mynewt-core/sys/shell @apache-mynewt-core/sys/stats/full
>> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/time/datetime
>> @apache-mynewt-core/util/cbmem @apache-mynewt-core/util/mem apps/blinky]
>> * @apache-mynewt-core/libc/baselibc <--
>> [@apache-mynewt-core/hw/bsp/nrf52dk] *
>> @apache-mynewt-core/sys/console/full <--
>> [@apache-mynewt-core/kernel/os(api:console)
>> @apache-mynewt-core/libc/baselibc(api:console)
>> @apache-mynewt-core/sys/shell(api:console) apps/blinky] *
>> @apache-mynewt-core/sys/defs <-- [@apache-mynewt-core/sys/flash_map] *
>> @apache-mynewt-core/sys/flash_map <-- [@apache-mynewt-core/sys/log/full
>> @apache-mynewt-core/sys/mfg @apache-mynewt-core/sys/sysinit] *
>> @apache-mynewt-core/sys/log/full <-- [apps/blinky] *
>> @apache-mynewt-core/sys/mfg <-- [@apache-mynewt-core/sys/flash_map] *
>> @apache-mynewt-core/sys/shell <-- [apps/blinky] *
>> @apache-mynewt-core/sys/stats/full <-- [apps/blinky] *
>> @apache-mynewt-core/sys/sysinit <-- [@apache-mynewt-core/kernel/os] *
>> @apache-mynewt-core/time/datetime <-- [@apache-mynewt-core/sys/shell] *
>> @apache-mynewt-core/util/cbmem <-- [@apache-mynewt-core/sys/log/full] *
>> @apache-mynewt-core/util/crc <-- [@apache-mynewt-core/sys/shell] *
>> @apache-mynewt-core/util/mem <-- [@apache-mynewt-core/kernel/os]
>>
>>
>> Thank you.
>>
>> Regards,
>>
>> Then Yoong Ze
>>
>>
>> On 10/2/2017 11:42 PM, Fabio Utzig wrote:
>>> No sure what you mean by "removed this fs part". What FS are you using?
>>>
>>> Could you provide the output of "newt target dep" and "newt target
>>> revdep"?
>>>
>>> Cheers,
>>> Fabio Utzig
>>>
>>> On Fri, Feb 10, 2017, at 10:59 AM, then yon wrote:
>>>> Dear Support,
>>>>
>>>> After updated to latest develop version, the fs code doesn't work
>>>> anymore.
>>>>
>>>> It gave me the following error:
>>>> 4:Unhandled interrupt (2), exception sp 0x200015a0 4: r0:0x000000
>>>> r1:0x00000000 r2:0x80000000 r3:0xe000ed0x0000cdf r5:0x000168b0
>>>> 4:ICSR:0x00421802 HFSR:0x0000000 C:0x00000 4:BFAR:0xe000ed38
>>>> MMFAR:0xe000ed34
>>>>
>>>> When i removed this fs part everything work well.
>>>>
>>>> Thank you.
>>>>
>>>> Regards,
>>>>     Then Yoong Ze
>>> .
>>>
> .
>


Re: file system fs/fs not working after updated to latest myNewt

Posted by Fabio Utzig <ut...@utzig.org>.
Your english is just fine. What surprised me is that you're using the fs
subsystem without any fs enabled (either having nffs or fatfs or both).
I was not expecting it, never tried it myself and it might indeed be a
bug.

Cheers,
Fabio Utzig

On Fri, Feb 10, 2017, at 02:01 PM, then yon wrote:
> Dear Fabio,
> 
> That means i removed all the code related to fs and the package 
> dependencies. Sorry for my bad english.
> 
> newt target dep blink_nordic
> 
> Dependency graph (depender --> [dependees]): * 
> @apache-mynewt-core/compiler/arm-none-eabi-m4 --> [] * 
> @apache-mynewt-core/encoding/base64 --> [] * @apache-mynewt-core/fs/disk 
> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/fs/fs --> 
> [@apache-mynewt-core/fs/disk] * @apache-mynewt-core/hw/bsp/nrf52dk --> 
> [@apache-mynewt-core/hw/drivers/uart/uart_hal 
> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx 
> @apache-mynewt-core/libc/baselibc] * @apache-mynewt-core/hw/cmsis-core 
> --> [] * @apache-mynewt-core/hw/drivers/uart --> [] * 
> @apache-mynewt-core/hw/drivers/uart/uart_hal --> 
> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal] * 
> @apache-mynewt-core/hw/hal --> [@apache-mynewt-core/kernel/os] * 
> @apache-mynewt-core/hw/mcu/nordic --> [@apache-mynewt-core/hw/cmsis-core 
> @apache-mynewt-core/hw/hal] * @apache-mynewt-core/hw/mcu/nordic/nrf52xxx 
> --> [@apache-mynewt-core/compiler/arm-none-eabi-m4 
> @apache-mynewt-core/hw/cmsis-core @apache-mynewt-core/hw/hal 
> @apache-mynewt-core/hw/mcu/nordic] * @apache-mynewt-core/kernel/os --> 
> [@apache-mynewt-core/sys/console/full(api:console) 
> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/util/mem] * 
> @apache-mynewt-core/libc/baselibc --> [@apache-mynewt-core/kernel/os 
> @apache-mynewt-core/sys/console/full(api:console)] * 
> @apache-mynewt-core/sys/console/full --> 
> [@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal 
> @apache-mynewt-core/kernel/os] * @apache-mynewt-core/sys/defs --> [] * 
> @apache-mynewt-core/sys/flash_map --> [@apache-mynewt-core/sys/defs 
> @apache-mynewt-core/sys/mfg] * @apache-mynewt-core/sys/log/full --> 
> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map 
> @apache-mynewt-core/util/cbmem] * @apache-mynewt-core/sys/mfg --> 
> [@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map] * 
> @apache-mynewt-core/sys/shell --> [@apache-mynewt-core/encoding/base64 
> @apache-mynewt-core/kernel/os 
> @apache-mynewt-core/sys/console/full(api:console) 
> @apache-mynewt-core/time/datetime @apache-mynewt-core/util/crc] * 
> @apache-mynewt-core/sys/stats/full --> [@apache-mynewt-core/kernel/os] * 
> @apache-mynewt-core/sys/sysinit --> [@apache-mynewt-core/kernel/os 
> @apache-mynewt-core/sys/flash_map] * @apache-mynewt-core/time/datetime 
> --> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/util/cbmem --> 
> [@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os] * 
> @apache-mynewt-core/util/crc --> [] * @apache-mynewt-core/util/mem --> 
> [@apache-mynewt-core/kernel/os] * apps/blinky --> 
> [@apache-mynewt-core/fs/fs @apache-mynewt-core/hw/hal 
> @apache-mynewt-core/kernel/os @apache-mynewt-core/sys/console/full 
> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/shell 
> @apache-mynewt-core/sys/stats/full] * targets/blink_nordic --> []
> 
> newt target revdep blink_nordic Reverse dependency graph (dependee <-- 
> [dependers]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 <-- 
> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] * 
> @apache-mynewt-core/encoding/base64 <-- [@apache-mynewt-core/sys/shell] 
> * @apache-mynewt-core/fs/disk <-- [@apache-mynewt-core/fs/fs] * 
> @apache-mynewt-core/fs/fs <-- [apps/blinky] * 
> @apache-mynewt-core/hw/cmsis-core <-- [@apache-mynewt-core/hw/mcu/nordic 
> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx] * 
> @apache-mynewt-core/hw/drivers/uart <-- 
> [@apache-mynewt-core/hw/drivers/uart/uart_hal 
> @apache-mynewt-core/sys/console/full] * 
> @apache-mynewt-core/hw/drivers/uart/uart_hal <-- 
> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/hw/hal <-- 
> [@apache-mynewt-core/hw/drivers/uart/uart_hal 
> @apache-mynewt-core/hw/mcu/nordic 
> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx 
> @apache-mynewt-core/sys/console/full @apache-mynewt-core/util/cbmem 
> apps/blinky] * @apache-mynewt-core/hw/mcu/nordic <-- 
> [@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] * 
> @apache-mynewt-core/hw/mcu/nordic/nrf52xxx <-- 
> [@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/kernel/os <-- 
> [@apache-mynewt-core/fs/disk @apache-mynewt-core/hw/hal 
> @apache-mynewt-core/libc/baselibc @apache-mynewt-core/sys/console/full 
> @apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/mfg 
> @apache-mynewt-core/sys/shell @apache-mynewt-core/sys/stats/full 
> @apache-mynewt-core/sys/sysinit @apache-mynewt-core/time/datetime 
> @apache-mynewt-core/util/cbmem @apache-mynewt-core/util/mem apps/blinky] 
> * @apache-mynewt-core/libc/baselibc <-- 
> [@apache-mynewt-core/hw/bsp/nrf52dk] * 
> @apache-mynewt-core/sys/console/full <-- 
> [@apache-mynewt-core/kernel/os(api:console) 
> @apache-mynewt-core/libc/baselibc(api:console) 
> @apache-mynewt-core/sys/shell(api:console) apps/blinky] * 
> @apache-mynewt-core/sys/defs <-- [@apache-mynewt-core/sys/flash_map] * 
> @apache-mynewt-core/sys/flash_map <-- [@apache-mynewt-core/sys/log/full 
> @apache-mynewt-core/sys/mfg @apache-mynewt-core/sys/sysinit] * 
> @apache-mynewt-core/sys/log/full <-- [apps/blinky] * 
> @apache-mynewt-core/sys/mfg <-- [@apache-mynewt-core/sys/flash_map] * 
> @apache-mynewt-core/sys/shell <-- [apps/blinky] * 
> @apache-mynewt-core/sys/stats/full <-- [apps/blinky] * 
> @apache-mynewt-core/sys/sysinit <-- [@apache-mynewt-core/kernel/os] * 
> @apache-mynewt-core/time/datetime <-- [@apache-mynewt-core/sys/shell] * 
> @apache-mynewt-core/util/cbmem <-- [@apache-mynewt-core/sys/log/full] * 
> @apache-mynewt-core/util/crc <-- [@apache-mynewt-core/sys/shell] * 
> @apache-mynewt-core/util/mem <-- [@apache-mynewt-core/kernel/os]
> 
> 
> Thank you.
> 
> Regards,
> 
> Then Yoong Ze
> 
> 
> On 10/2/2017 11:42 PM, Fabio Utzig wrote:
> > No sure what you mean by "removed this fs part". What FS are you using?
> >
> > Could you provide the output of "newt target dep" and "newt target
> > revdep"?
> >
> > Cheers,
> > Fabio Utzig
> >
> > On Fri, Feb 10, 2017, at 10:59 AM, then yon wrote:
> >> Dear Support,
> >>
> >> After updated to latest develop version, the fs code doesn't work
> >> anymore.
> >>
> >> It gave me the following error:
> >> 4:Unhandled interrupt (2), exception sp 0x200015a0 4: r0:0x000000
> >> r1:0x00000000 r2:0x80000000 r3:0xe000ed0x0000cdf r5:0x000168b0
> >> 4:ICSR:0x00421802 HFSR:0x0000000 C:0x00000 4:BFAR:0xe000ed38
> >> MMFAR:0xe000ed34
> >>
> >> When i removed this fs part everything work well.
> >>
> >> Thank you.
> >>
> >> Regards,
> >>    Then Yoong Ze
> > .
> >
> 

Re: file system fs/fs not working after updated to latest myNewt

Posted by then yon <yz...@free2move.se>.
Dear Fabio,

That means i removed all the code related to fs and the package 
dependencies. Sorry for my bad english.

newt target dep blink_nordic

Dependency graph (depender --> [dependees]): * 
@apache-mynewt-core/compiler/arm-none-eabi-m4 --> [] * 
@apache-mynewt-core/encoding/base64 --> [] * @apache-mynewt-core/fs/disk 
--> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/fs/fs --> 
[@apache-mynewt-core/fs/disk] * @apache-mynewt-core/hw/bsp/nrf52dk --> 
[@apache-mynewt-core/hw/drivers/uart/uart_hal 
@apache-mynewt-core/hw/mcu/nordic/nrf52xxx 
@apache-mynewt-core/libc/baselibc] * @apache-mynewt-core/hw/cmsis-core 
--> [] * @apache-mynewt-core/hw/drivers/uart --> [] * 
@apache-mynewt-core/hw/drivers/uart/uart_hal --> 
[@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal] * 
@apache-mynewt-core/hw/hal --> [@apache-mynewt-core/kernel/os] * 
@apache-mynewt-core/hw/mcu/nordic --> [@apache-mynewt-core/hw/cmsis-core 
@apache-mynewt-core/hw/hal] * @apache-mynewt-core/hw/mcu/nordic/nrf52xxx 
--> [@apache-mynewt-core/compiler/arm-none-eabi-m4 
@apache-mynewt-core/hw/cmsis-core @apache-mynewt-core/hw/hal 
@apache-mynewt-core/hw/mcu/nordic] * @apache-mynewt-core/kernel/os --> 
[@apache-mynewt-core/sys/console/full(api:console) 
@apache-mynewt-core/sys/sysinit @apache-mynewt-core/util/mem] * 
@apache-mynewt-core/libc/baselibc --> [@apache-mynewt-core/kernel/os 
@apache-mynewt-core/sys/console/full(api:console)] * 
@apache-mynewt-core/sys/console/full --> 
[@apache-mynewt-core/hw/drivers/uart @apache-mynewt-core/hw/hal 
@apache-mynewt-core/kernel/os] * @apache-mynewt-core/sys/defs --> [] * 
@apache-mynewt-core/sys/flash_map --> [@apache-mynewt-core/sys/defs 
@apache-mynewt-core/sys/mfg] * @apache-mynewt-core/sys/log/full --> 
[@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map 
@apache-mynewt-core/util/cbmem] * @apache-mynewt-core/sys/mfg --> 
[@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/flash_map] * 
@apache-mynewt-core/sys/shell --> [@apache-mynewt-core/encoding/base64 
@apache-mynewt-core/kernel/os 
@apache-mynewt-core/sys/console/full(api:console) 
@apache-mynewt-core/time/datetime @apache-mynewt-core/util/crc] * 
@apache-mynewt-core/sys/stats/full --> [@apache-mynewt-core/kernel/os] * 
@apache-mynewt-core/sys/sysinit --> [@apache-mynewt-core/kernel/os 
@apache-mynewt-core/sys/flash_map] * @apache-mynewt-core/time/datetime 
--> [@apache-mynewt-core/kernel/os] * @apache-mynewt-core/util/cbmem --> 
[@apache-mynewt-core/hw/hal @apache-mynewt-core/kernel/os] * 
@apache-mynewt-core/util/crc --> [] * @apache-mynewt-core/util/mem --> 
[@apache-mynewt-core/kernel/os] * apps/blinky --> 
[@apache-mynewt-core/fs/fs @apache-mynewt-core/hw/hal 
@apache-mynewt-core/kernel/os @apache-mynewt-core/sys/console/full 
@apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/shell 
@apache-mynewt-core/sys/stats/full] * targets/blink_nordic --> []

newt target revdep blink_nordic Reverse dependency graph (dependee <-- 
[dependers]): * @apache-mynewt-core/compiler/arm-none-eabi-m4 <-- 
[@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] * 
@apache-mynewt-core/encoding/base64 <-- [@apache-mynewt-core/sys/shell] 
* @apache-mynewt-core/fs/disk <-- [@apache-mynewt-core/fs/fs] * 
@apache-mynewt-core/fs/fs <-- [apps/blinky] * 
@apache-mynewt-core/hw/cmsis-core <-- [@apache-mynewt-core/hw/mcu/nordic 
@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] * 
@apache-mynewt-core/hw/drivers/uart <-- 
[@apache-mynewt-core/hw/drivers/uart/uart_hal 
@apache-mynewt-core/sys/console/full] * 
@apache-mynewt-core/hw/drivers/uart/uart_hal <-- 
[@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/hw/hal <-- 
[@apache-mynewt-core/hw/drivers/uart/uart_hal 
@apache-mynewt-core/hw/mcu/nordic 
@apache-mynewt-core/hw/mcu/nordic/nrf52xxx 
@apache-mynewt-core/sys/console/full @apache-mynewt-core/util/cbmem 
apps/blinky] * @apache-mynewt-core/hw/mcu/nordic <-- 
[@apache-mynewt-core/hw/mcu/nordic/nrf52xxx] * 
@apache-mynewt-core/hw/mcu/nordic/nrf52xxx <-- 
[@apache-mynewt-core/hw/bsp/nrf52dk] * @apache-mynewt-core/kernel/os <-- 
[@apache-mynewt-core/fs/disk @apache-mynewt-core/hw/hal 
@apache-mynewt-core/libc/baselibc @apache-mynewt-core/sys/console/full 
@apache-mynewt-core/sys/log/full @apache-mynewt-core/sys/mfg 
@apache-mynewt-core/sys/shell @apache-mynewt-core/sys/stats/full 
@apache-mynewt-core/sys/sysinit @apache-mynewt-core/time/datetime 
@apache-mynewt-core/util/cbmem @apache-mynewt-core/util/mem apps/blinky] 
* @apache-mynewt-core/libc/baselibc <-- 
[@apache-mynewt-core/hw/bsp/nrf52dk] * 
@apache-mynewt-core/sys/console/full <-- 
[@apache-mynewt-core/kernel/os(api:console) 
@apache-mynewt-core/libc/baselibc(api:console) 
@apache-mynewt-core/sys/shell(api:console) apps/blinky] * 
@apache-mynewt-core/sys/defs <-- [@apache-mynewt-core/sys/flash_map] * 
@apache-mynewt-core/sys/flash_map <-- [@apache-mynewt-core/sys/log/full 
@apache-mynewt-core/sys/mfg @apache-mynewt-core/sys/sysinit] * 
@apache-mynewt-core/sys/log/full <-- [apps/blinky] * 
@apache-mynewt-core/sys/mfg <-- [@apache-mynewt-core/sys/flash_map] * 
@apache-mynewt-core/sys/shell <-- [apps/blinky] * 
@apache-mynewt-core/sys/stats/full <-- [apps/blinky] * 
@apache-mynewt-core/sys/sysinit <-- [@apache-mynewt-core/kernel/os] * 
@apache-mynewt-core/time/datetime <-- [@apache-mynewt-core/sys/shell] * 
@apache-mynewt-core/util/cbmem <-- [@apache-mynewt-core/sys/log/full] * 
@apache-mynewt-core/util/crc <-- [@apache-mynewt-core/sys/shell] * 
@apache-mynewt-core/util/mem <-- [@apache-mynewt-core/kernel/os]


Thank you.

Regards,

Then Yoong Ze


On 10/2/2017 11:42 PM, Fabio Utzig wrote:
> No sure what you mean by "removed this fs part". What FS are you using?
>
> Could you provide the output of "newt target dep" and "newt target
> revdep"?
>
> Cheers,
> Fabio Utzig
>
> On Fri, Feb 10, 2017, at 10:59 AM, then yon wrote:
>> Dear Support,
>>
>> After updated to latest develop version, the fs code doesn't work
>> anymore.
>>
>> It gave me the following error:
>> 4:Unhandled interrupt (2), exception sp 0x200015a0 4: r0:0x000000
>> r1:0x00000000 r2:0x80000000 r3:0xe000ed0x0000cdf r5:0x000168b0
>> 4:ICSR:0x00421802 HFSR:0x0000000 C:0x00000 4:BFAR:0xe000ed38
>> MMFAR:0xe000ed34
>>
>> When i removed this fs part everything work well.
>>
>> Thank you.
>>
>> Regards,
>>    Then Yoong Ze
> .
>


Re: file system fs/fs not working after updated to latest myNewt

Posted by Fabio Utzig <ut...@utzig.org>.
No sure what you mean by "removed this fs part". What FS are you using?

Could you provide the output of "newt target dep" and "newt target
revdep"?

Cheers,
Fabio Utzig

On Fri, Feb 10, 2017, at 10:59 AM, then yon wrote:
> Dear Support,
> 
> After updated to latest develop version, the fs code doesn't work
> anymore.
> 
> It gave me the following error:
> 4:Unhandled interrupt (2), exception sp 0x200015a0 4: r0:0x000000 
> r1:0x00000000 r2:0x80000000 r3:0xe000ed0x0000cdf r5:0x000168b0 
> 4:ICSR:0x00421802 HFSR:0x0000000 C:0x00000 4:BFAR:0xe000ed38 
> MMFAR:0xe000ed34
> 
> When i removed this fs part everything work well.
> 
> Thank you.
> 
> Regards,
>   Then Yoong Ze

file system fs/fs not working after updated to latest myNewt

Posted by then yon <yz...@free2move.se>.
Dear Support,

After updated to latest develop version, the fs code doesn't work anymore.

It gave me the following error:
4:Unhandled interrupt (2), exception sp 0x200015a0 4: r0:0x000000 
r1:0x00000000 r2:0x80000000 r3:0xe000ed0x0000cdf r5:0x000168b0 
4:ICSR:0x00421802 HFSR:0x0000000 C:0x00000 4:BFAR:0xe000ed38 
MMFAR:0xe000ed34

When i removed this fs part everything work well.

Thank you.

Regards,
  Then Yoong Ze

Re: os_time_delay in milliseconds / microseconds

Posted by will sanfilippo <wi...@runtime.io>.
os_cputime_delay_ticks does not put the task to sleep; it was meant for short blocking delays. The nrf_delay_ms() function doesnt put the task to sleep either so I am not sure why you are seeing a difference between the two. 

> On Jan 26, 2017, at 6:03 AM, then yon <yz...@free2move.se> wrote:
> 
> Dear Jiacheng,
> 
> Thanks for your reply.
> 
> When i used os_cputime_delay_ticks() function it will cause my app hang and it will never goes into idle stat.
> 
> I found the solution by using the nrf_delay_ms from nordic sdk.
> 
> Thank you.
> 
> Regards,
> 
> Then Yoong Ze
> 
> 
> On 26/1/2017 7:41 PM, WangJiacheng wrote:
>> Hi Then,
>> 
>> The OS time tick resolution is defined by OS_TICKS_PER_SEC.
>> 
>> If you want higher time resolution, use CPU time. The default CPU time tick is 1 microsecond, function os_cputime_delay_ticks() should be used.
>> 
>> Moreover, you can change CPU timing frequency to change CLOCK_FREQ and OS_CPUTIME_FREQ in syscfg.yml.
>> 
>> Jiacheng
>> 
>> 
>> 
>>> 在 2017年1月26日,16:00,then yon <yz...@free2move.se> 写道:
>>> 
>>> Dear Support,
>>> 
>>> I'm working on a timing critical app; but the os_time_delay didn't gave me a precise timing.
>>> 
>>> Currently the min delay i can get is more than 2ms with os_time_delay function.
>>> 
>>> Somehow i notice that the clock time have up to microsecond precision; but how do i make a delay with that?
>>> 
>>> Thank you.
>>> 
>>> Regards,
>>> 
>>> Then Yoong Ze
>> .
>> 
> 


Re: os_time_delay in milliseconds / microseconds

Posted by then yon <yz...@free2move.se>.
Dear Jiacheng,

Thanks for your reply.

When i used os_cputime_delay_ticks() function it will cause my app hang 
and it will never goes into idle stat.

I found the solution by using the nrf_delay_ms from nordic sdk.

Thank you.

Regards,

Then Yoong Ze


On 26/1/2017 7:41 PM, WangJiacheng wrote:
> Hi Then,
>
> The OS time tick resolution is defined by OS_TICKS_PER_SEC.
>
> If you want higher time resolution, use CPU time. The default CPU time tick is 1 microsecond, function os_cputime_delay_ticks() should be used.
>
> Moreover, you can change CPU timing frequency to change CLOCK_FREQ and OS_CPUTIME_FREQ in syscfg.yml.
>
> Jiacheng
>
>
>
>>  2017126\u056316:00then yon <yz...@free2move.se> \u0434
>>
>> Dear Support,
>>
>> I'm working on a timing critical app; but the os_time_delay didn't gave me a precise timing.
>>
>> Currently the min delay i can get is more than 2ms with os_time_delay function.
>>
>> Somehow i notice that the clock time have up to microsecond precision; but how do i make a delay with that?
>>
>> Thank you.
>>
>> Regards,
>>
>> Then Yoong Ze
> .
>


Re: os_time_delay in milliseconds / microseconds

Posted by WangJiacheng <ji...@icloud.com>.
Hi Then,

The OS time tick resolution is defined by OS_TICKS_PER_SEC.

If you want higher time resolution, use CPU time. The default CPU time tick is 1 microsecond, function os_cputime_delay_ticks() should be used.

Moreover, you can change CPU timing frequency to change CLOCK_FREQ and OS_CPUTIME_FREQ in syscfg.yml.

Jiacheng



> 在 2017年1月26日,16:00,then yon <yz...@free2move.se> 写道:
> 
> Dear Support,
> 
> I'm working on a timing critical app; but the os_time_delay didn't gave me a precise timing.
> 
> Currently the min delay i can get is more than 2ms with os_time_delay function.
> 
> Somehow i notice that the clock time have up to microsecond precision; but how do i make a delay with that?
> 
> Thank you.
> 
> Regards,
> 
> Then Yoong Ze


os_time_delay in milliseconds / microseconds

Posted by then yon <yz...@free2move.se>.
Dear Support,

I'm working on a timing critical app; but the os_time_delay didn't gave 
me a precise timing.

Currently the min delay i can get is more than 2ms with os_time_delay 
function.

Somehow i notice that the clock time have up to microsecond precision; 
but how do i make a delay with that?

Thank you.

Regards,

Then Yoong Ze

Re: Firmware update with MyNewt

Posted by then yon <yz...@free2move.se>.
Dear Chris,

As per your suggestion i been tried to work out newtmgr with slinky 
example, but unfortunately i getting the same result.

I believe i mssing some step over here, please help me to check on my 
procedure.

$ newt target create split_slinky Target targets/split_slinky 
successfully created $ newt target set split_slinky 
loader=@apache-mynewt-core/apps/slinky Target targets/split_slinky 
successfully set target.loader <http://target.loader/>to 
@apache-mynewt-core/apps/slinky $ newt target set split_slinky 
app=@apache-mynewt-core/apps/splitty Target targets/split_slinky 
successfully set target.app <http://target.app/>to 
@apache-mynewt-core/apps/splitty $ newt target set split_slinky 
bsp=@apache-mynewt-core/hw/bsp/nrf52dk Target targets/split_slinky 
successfully set target.bsp <http://target.bsp/>to 
@apache-mynewt-core/hw/bsp/nrf52dk $ newt target set split_slinky 
build_profile=optimized Target targets/split_slinky successfully set 
target.build_profile <http://target.build_profile/>to optimized $ newt 
build split_slinky

$ newt size split_slinky Size of Application Image: app FLASH RAM 37 
9944 *fill* 112 0 crt0.o <http://crt0.o/>8 0 crti.o <http://crti.o/>16 0 
crtn.o <http://crtn.o/>308 1064 libg.a <http://libg.a/>124 432 nrf52dk.a 
<http://nrf52dk.a/>66 0 split_slinky-sysinit-app.a 
<http://split_slinky-sysinit-app.a/>697 2748 splitty.a 
<http://splitty.a/>objsize text data bss dec hex filename 1336 1064 
12724 15124 3b14 
/home//myNewtProj/bin/targets/split_slinky/app/apps/splitty/splitty.elf 
<http://splitty.elf/>Size of Loader Image: loader FLASH RAM 127 255 
*fill* 441 0 base64.a <http://base64.a/>2084 32 baselibc.a 
<http://baselibc.a/>1420 100 bootutil.a <http://bootutil.a/>394 0 
cbmem.a <http://cbmem.a/>852 0 cborattr.a <http://cborattr.a/>64 0 
cmsis-core.a <http://cmsis-core.a/>2595 217 config.a 
<http://config.a/>620 0 crc.a <http://crc.a/>112 0 crt0.o 
<http://crt0.o/>8 0 crti.o <http://crti.o/>16 0 crtn.o 
<http://crtn.o/>1252 0 datetime.a <http://datetime.a/>1696 0 fcb.a 
<http://fcb.a/>480 128 flash_map.a <http://flash_map.a/>1182 12 
flash_test.a <http://flash_test.a/>1167 201 full.a <http://full.a/>374 0 
hal.a <http://hal.a/>459 133 id.a <http://id.a/>1913 24 imgmgr.a 
<http://imgmgr.a/>308 1064 libg.a <http://libg.a/>1492 0 libgcc.a 
<http://libgcc.a/>3399 109 log.a <http://log.a/>1200 0 mbedtls.a 
<http://mbedtls.a/>52 0 mem.a <http://mem.a/>376 12 mfg.a 
<http://mfg.a/>219 20 mgmt.a <http://mgmt.a/>756 100 newtmgr.a 
<http://newtmgr.a/>1368 44 nmgr_os.a <http://nmgr_os.a/>105 32 
nmgr_shell.a <http://nmgr_shell.a/>504 496 nrf52dk.a 
<http://nrf52dk.a/>3288 68 nrf52xxx.a <http://nrf52xxx.a/>6681 4045 os.a 
<http://os.a/>732 140 reboot.a <http://reboot.a/>2428 239 shell.a 
<http://shell.a/>980 2806 slinky.a <http://slinky.a/>467 26 split.a 
<http://split.a/>72 0 split_slinky-sysinit-app.a 
<http://split_slinky-sysinit-app.a/>66 0 split_slinky-sysinit-loader.a 
<http://split_slinky-sysinit-loader.a/>1325 73 stats.a 
<http://stats.a/>2352 0 tinycbor.a <http://tinycbor.a/>249 0 uart_hal.a 
<http://uart_hal.a/>objsize text data bss dec hex filename 45616 1592 
8384 55592 d928 
/home/myNewtProj/bin/targets/split_slinky/loader/apps/slinky/slinky.elf 
<http://slinky.elf/>

j$ newt create-image split_slinky 1.0.0 <http://1.0.0.0/>Archiving 
nordic.a <http://nordic.a/>Compiling split_slinky-sysflash.c 
<http://split_slinky-sysflash.c/>Compiling split_slinky-sysinit-app.c 
<http://split_slinky-sysinit-app.c/>Compiling 
split_slinky-sysinit-loader.c 
<http://split_slinky-sysinit-loader.c/>Archiving 
split_slinky-sysinit-app.a <http://split_slinky-sysinit-app.a/>Linking 
/home/myNewtProj/bin/targets/split_slinky/app/apps/splitty/splitty_tmp.elf 
<http://splitty_tmp.elf/>Archiving nordic.a <http://nordic.a/>Compiling 
split_slinky-sysflash.c <http://split_slinky-sysflash.c/>Compiling 
split_slinky-sysinit-app.c <http://split_slinky-sysinit-app.c/>Compiling 
split_slinky-sysinit-loader.c 
<http://split_slinky-sysinit-loader.c/>Archiving 
split_slinky-sysinit-loader.a 
<http://split_slinky-sysinit-loader.a/>Linking 
/home/myNewtProj/bin/targets/split_slinky/loader/apps/slinky/slinky_tmp.elf 
<http://slinky_tmp.elf/>Linking 
/home/myNewtProj/bin/targets/split_slinky/loader/apps/slinky/slinky.elf 
<http://slinky.elf/>Generating ROM elf Linking 
/home/myNewtProj/bin/targets/split_slinky/app/apps/splitty/splitty.elf 
<http://splitty.elf/>App image succesfully generated: 
/home/myNewtProj/bin/targets/split_slinky/loader/apps/slinky/slinky.img 
<http://slinky.img/>App image succesfully generated: 
/home/myNewtProj/bin/targets/split_slinky/app/apps/splitty/splitty.img 
<http://splitty.img/>$ newt load split_slinky 0 Loading app image into 
slot 2 Loading loader image into slot 1 $ newtmgr echo -c mynewt_serial 
hello

Another possible issue i can think of is i get the following error when 
issue the newtmgr command:

Error: open /dev/ttyACM0: permission denied

And i used the following command to solve the error above:

sudo chmod 666 /dev/ttyACM0


Appreciate on your help, thank you very much.

Regards,

Then Yoong Ze


On 22/1/2017 3:43 PM, Christopher Collins wrote:
> Hi Then,
>
> On Sun, Jan 22, 2017 at 08:39:45AM +0800, then yon wrote:
>> Dear Jacob,
>>
>> Thanks for your verification, so that means i need to use newtmgr for
>> ota update.
>>
>> I tried on newtmgr but i stuck when i tried to do something with the
>> remote endpoint.
>>
>> Here what i did:
>>
>>
>> Then it stuck there, it same for any other command that required
>> interaction with remote endpoint.
>>
>> My remote endpoint is nrf52dk board with bootloader and a working app
>> loaded.
>>
>> Another noob question here, how do i add a newtmge ota update conn? Is
>> that add a ble conn?
> I recommend trying the "slinky" app.  This app is configured to support
> newtmgr and image management, so you can use it to verify that your
> serial setup is correct.
>
> To support newtmgr in your app, you will need to:
>
> 1. Make sure the following packages get pulled in to the build:
>
>      - mgmt/imgmgr
>      - mgmt/newtmgr
>      - mgmt/newtmgr/transport/nmgr_shell
>      - sys/console/full
>      - sys/shell
>
> The easiest way to do this is to add these entries to your app's or
> target's pkg.yml file, in the "pkg.deps" section.
>
> 2. Enable the SHELL_TASK syscfg setting.  You can do this by adding the
> following lines to your app's or target's syscfg.yml file:
>
>      syscfg.vals:
>          # Enable the shell task.
>          SHELL_TASK: 1
>
> If "syscfg.vals" is already present in the file, then you just need to
> add the "SHELL_TASK: 1" line under it.
>
> Chris
> .
>


Re: Firmware update with MyNewt

Posted by Christopher Collins <cc...@apache.org>.
Hi Then,

On Sun, Jan 22, 2017 at 08:39:45AM +0800, then yon wrote:
> Dear Jacob,
> 
> Thanks for your verification, so that means i need to use newtmgr for 
> ota update.
> 
> I tried on newtmgr but i stuck when i tried to do something with the 
> remote endpoint.
> 
> Here what i did:
> 
> 
> Then it stuck there, it same for any other command that required 
> interaction with remote endpoint.
> 
> My remote endpoint is nrf52dk board with bootloader and a working app 
> loaded.
> 
> Another noob question here, how do i add a newtmge ota update conn? Is 
> that add a ble conn?

I recommend trying the "slinky" app.  This app is configured to support
newtmgr and image management, so you can use it to verify that your
serial setup is correct.

To support newtmgr in your app, you will need to:

1. Make sure the following packages get pulled in to the build:

    - mgmt/imgmgr
    - mgmt/newtmgr
    - mgmt/newtmgr/transport/nmgr_shell
    - sys/console/full
    - sys/shell

The easiest way to do this is to add these entries to your app's or
target's pkg.yml file, in the "pkg.deps" section.

2. Enable the SHELL_TASK syscfg setting.  You can do this by adding the
following lines to your app's or target's syscfg.yml file:

    syscfg.vals:
        # Enable the shell task.
        SHELL_TASK: 1

If "syscfg.vals" is already present in the file, then you just need to
add the "SHELL_TASK: 1" line under it.

Chris

Re: Changes in the filesystem on the lastest developer version

Posted by then yon <yz...@free2move.se>.
Dear Chris,

Something to add on, even the ESB interrupt not working but filesystem 
works correctly.

Only 1 filesystem is using in our project.

Thank you.

Regards,

Then Yoong Ze


On 20/2/2017 1:50 PM, then yon wrote:
> Dear Chris,
>
> Thanks for your fast response.
>
> The failure is the ESB interrupt doesn't triggered.
>
> Sorry that i not really sure how to see the the version; cause i 
> having same 1.0.0-dev for both old and new version. (By using newt 
> version command)
>
> From what i remembered the last working version is the first released 
> of 1.0.0-dev.
>
> Thank you.
>
> Regards,
>
> Then Yoong Ze
>
> On 20/2/2017 1:27 PM, Christopher Collins wrote:
>> Hi Then,
>>
>> On Mon, Feb 20, 2017 at 12:52:30PM +0800, then yon wrote:
>>> Dear Support,
>>>
>>> Can i know that is the changes on the new filesystem?
>>>
>>> We are working on esb project instead of ble; somehow after we 
>>> update to
>>> latest developer version the esb part doesn't work anymore.
>>>
>>> ps: By disabling the filesystem code it worked perfectly.
>> To my knowledge, the only change was support for multiple concurrent
>> file systems (https://github.com/apache/incubator-mynewt-core/pull/158).
>>
>> Could you describe the failure mode you are seeing?  Also, could you
>> please indicate which version worked and which version does not work
>> (version number or commit hash)?
>>
>> Thanks,
>> Chris
>> .
>>
>


Re: Changes in the filesystem on the lastest developer version

Posted by then yon <yz...@free2move.se>.
Dear Chris,

Thanks for your fast response.

The failure is the ESB interrupt doesn't triggered.

Sorry that i not really sure how to see the the version; cause i having 
same 1.0.0-dev for both old and new version. (By using newt version command)

 From what i remembered the last working version is the first released 
of 1.0.0-dev.

Thank you.

Regards,

Then Yoong Ze

On 20/2/2017 1:27 PM, Christopher Collins wrote:
> Hi Then,
>
> On Mon, Feb 20, 2017 at 12:52:30PM +0800, then yon wrote:
>> Dear Support,
>>
>> Can i know that is the changes on the new filesystem?
>>
>> We are working on esb project instead of ble; somehow after we update to
>> latest developer version the esb part doesn't work anymore.
>>
>> ps: By disabling the filesystem code it worked perfectly.
> To my knowledge, the only change was support for multiple concurrent
> file systems (https://github.com/apache/incubator-mynewt-core/pull/158).
>
> Could you describe the failure mode you are seeing?  Also, could you
> please indicate which version worked and which version does not work
> (version number or commit hash)?
>
> Thanks,
> Chris
> .
>


Re: Changes in the filesystem on the lastest developer version

Posted by Christopher Collins <ch...@runtime.io>.
Hi Then,

On Mon, Feb 20, 2017 at 12:52:30PM +0800, then yon wrote:
> Dear Support,
> 
> Can i know that is the changes on the new filesystem?
> 
> We are working on esb project instead of ble; somehow after we update to 
> latest developer version the esb part doesn't work anymore.
> 
> ps: By disabling the filesystem code it worked perfectly.

To my knowledge, the only change was support for multiple concurrent
file systems (https://github.com/apache/incubator-mynewt-core/pull/158).

Could you describe the failure mode you are seeing?  Also, could you
please indicate which version worked and which version does not work
(version number or commit hash)?

Thanks,
Chris

Re: image upload error 2

Posted by then yon <yz...@free2move.se>.
Dear Chris,

If not mistaken the app will be my project firmware.

And what i doing is a firmware upgrade method?

Cause in the previous support, they said this tutorial is the best 
starter for firmware upgrade.


Please let me know if i made a terrible mistake here.

Regards,

Then Yoong Ze


On 24/2/2017 9:57 AM, Christopher Collins wrote:
> On Fri, Feb 24, 2017 at 09:39:37AM +0800, then yon wrote:
>> Dear Chris,
>>
>> i've double enter on each line but it still mix up into 1 line, most
>> probably is my email sw problem.
>>
>> Below is all the step i did:
>>
>> 1. By using slinky app(no changes); build a split_slinky target.
> Stop right there :).  What are you using for a loader and what are you
> using for an app?
>
> Chris
> .
>


Re: image upload error 2

Posted by Christopher Collins <ch...@runtime.io>.
On Fri, Feb 24, 2017 at 09:39:37AM +0800, then yon wrote:
> Dear Chris,
> 
> i've double enter on each line but it still mix up into 1 line, most 
> probably is my email sw problem.
> 
> Below is all the step i did:
> 
> 1. By using slinky app(no changes); build a split_slinky target.

Stop right there :).  What are you using for a loader and what are you
using for an app?

Chris

Re: image upload error 2

Posted by then yon <yz...@free2move.se>.
Dear Chris,

i've double enter on each line but it still mix up into 1 line, most 
probably is my email sw problem.

Below is all the step i did:

1. By using slinky app(no changes); build a split_slinky target.

2. "newt load split_slinky".

3. newtmgr -c mynewt_serial image list. (slot 1 flags: empty, able to do 
image upload here)

4. Enabling the app by, "newtmgr -c mynewt_serial image test". (slot 1 
flags: pending)

5. "newtmgr -c mynewt_serial image reset". (Here is where is need to 
reset the power, only the first time)

6. After power reset (slot 1 flags: active); sent "newtmgr -c 
mynewt_serial iamge confirm" (slot 1 flags: active confirmed; now the 
LED start blinking)

7. Now try to do image upgrade; "newtmgr -c mynewt_serial image test", 
here i get "Error: rc =6"


Thank you.

Regards,

Then Yoong Ze


The empty flag for slot 1 is only happen after i load the image using "newt load split_slinky".

Then from the tutorial the next step is enabling a split application, here is where the test command came in. (slot 1 flags: active confirmed)

So after the app is running; now i wanted to do image upgrade.

So i sent test command in step 1. (slot 1 flags: active pending; and after many many tried it gave me Error: rc=6)

  


Thank you.

Regards,

Then Yoong Ze


On 24/2/2017 12:56 AM, Christopher Collins wrote:
> On Thu, Feb 23, 2017 at 06:05:44PM +0800, then yon wrote:
>> Dear Chris,
>>
>> Yes, i've followed the step you given; but after step 2 it gave me
>> "Error: Timeout reading from serial connection".
>>
>> It only recover after i reset nrf52dk power and it show the result i
>> sent to you previously.
>>
>> And when i tried to do step 1 again, it gave me "Error:  rc=6"
> Is there anything you can do to preserve the newtmgr output in your
> emails?  For some reason, the entire newtmgr response gets joined into a
> single line, making it difficult to read.  I have reformatted the
> responses below.
>
>      $ newtmgr -c mynewt_serial image list
>      Images:
>        slot=0
>          version: 1.0.0
>          bootable: true
>          flags: active confirmed
>          hash: 6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c
>        slot=1
>          version: 1.0.0
>          bootable: false
>          flags:
>          hash: 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b
>      Split status: matching
>
> The empty flags field in slot 1 indicates that the device is in
> loader-only mode (i.e., only slot 0 is running).  It appears you have
> completed step 3.  With slot 1 unused, you can overwrite it with a new
> app.
>
>      $ newtmgr -c mynewt_serial image test 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b
>      Images:
>        slot=0
>          version: 1.0.0
>          bootable: true
>          flags: active confirmed
>          hash: 6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c
>        slot=1
>          version: 1.0.0
>          bootable: false
>          flags: pending
>          hash: 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b
>      Split status: matching
>
> The "test" command does not come until step 5.  What about step 4,
> uploading the new loader?  By testing the original app image, you will
> just put the device back into its original state.
>
>      $ newtmgr -c mynewt_serial reset
>      Done
>
>      $ newtmgr -c mynewt_serial image list  ^C (cause it hang here indefinitely so i cancel it)
>
> It seems like your app (slot 1) doesn't support newtmgr or lacks a
> newtmgr transport.
>
>      $ newtmgr -c mynewt_serial image upload splitty.img
>      Error: Timeout reading from serial connection
>      [...]
>
> Which procedure are you following?  In the split upgrade procedure (the
> one I pasted in my previous email), you only upload after issuing the
> "image confirm" command.
>
> Can you please do the following:
>
> 1. Tell me something about the target you are upgrading.  What loader
> and app combo are you using?  From the above, it appears your app may
> not support newtmgr.
>
> 2. Start from step 1 in the procedure I quoted, please indicate which
> step you are currently on, and don't skip any steps :).
>
> Thanks,
> Chris
>
>> $ newtmgr -c mynewt_serial image list Images:  slot=0  version: 1.0.0
>> <http://1.0.0.0/> bootable: true  flags: active confirmed  hash:
>> 6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c  slot=1
>>    version: 1.0.0 <http://1.0.0.0/> bootable: false  flags: hash:
>> 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b  Split
>> status: matching $ newtmgr -c mynewt_serial image test 0fd
>> 6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b  Images:
>>    slot=0  version: 1.0.0 <http://1.0.0.0/> bootable: true  flags: active
>> confirmed  hash:
>> 6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c  slot=1
>>    version: 1.0.0 <http://1.0.0.0/> bootable: false  flags: pending
>>    hash: 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b
>>    Split status: matching $ newtmgr -c mynewt_serial reset  Done $
>> newtmgr -c mynewt_serial image list  ^C (cause it hang here indefinitely
>> so i cancel it) $ newtmgr -c mynewt_serial image upload splitty.img
>> <http://plitty.img/>Error: Timeout reading from serial connection
>>    upload - Upload image to target  Usage:  newtmgr image upload [flags]
>>    Examples:  newtmgr -c olimex image upload <image_file  newtmgr -c
>> olimex image upload bin/slinky_zero/apps/slinky.img
>> <http://slinky.img/> Global Flags:  -c, --conn string connection profile
>> to use.  -l, --loglevel string log level to use (default INFO.)
>> <http://info.%29/>(default "info")  -t, --trace print all bytes
>> transmitted and received
>>
>>
>> Thank you.
>>
>> Regards,
>>
>> Then Yoong Ze
>>
>>
>> On 23/2/2017 12:44 AM, Christopher Collins wrote:
>>> Hi Then,
>>>
>>> On Wed, Feb 22, 2017 at 02:11:36PM +0800, then yon wrote:
>>>> Dear Support,
>>>>
>>>> I'm followed the tutorial below:
>>>> https://mynewt.apache.org/latest/os/modules/split/split/
>>>>
>>>> But i'm stuck at image upload step; it gave me the following error:
>>> [...]
>>>> Error: Target error: 2
>>> Error 2 indicates that there is no free slot for the new image.  In your
>>> email, the "image list" output is a bit touch to read because it got
>>> collapsed into a single line.  Here is my attempt to unravel it:
>>>
>>>> $ newtmgr -c mynewt_serial image list
>>>> Images:
>>>>       slot=0
>>>>           version: 1.0.0
>>>>           bootable: true
>>>>           flags: active confirmed
>>>>           hash: 493c5e78e76a9c1b9e574ab38b7bbf0d342d928ffd0111400dbe8c2c952da68e
>>>>
>>>>       slot=1
>>>>           version: 1.0.0
>>>>           bootable: false
>>>>           flags: active confirmed
>>>>           hash: 4d26a0d1596e12dab9059df3a13b4ffd54f96836cd9080d579c6afc167d58e81
>>>>
>>>>       Split status: matching
>>> Notice that both slots have the "active" and "confirmed" flags set.
>>> This indicates that both slots are currently running.  You need to run
>>> the image in loader-only mode in order to replace the app in slot 1.
>>> This is described in the "Image Upgrade - Split" section of the page you
>>> linked to (https://mynewt.apache.org/latest/os/modules/split/split/).
>>> Specifically:
>>>
>>>
>>> 1. Disable split functionality; we need to deactivate the application
>>>      image in slot 1 (newtmgr image test <current-loader-hash>).
>>> 2. Reboot device (newtmgr reset).
>>> 3. Make above change permanent (newtmgr image confirm).
>>> 4. Upload new loader to slot 1 (newtmgr image upload <filename>).
>>> 5. Tell device to "test out" the new loader on next boot (newtmgr image
>>>      test <new-loader-hash>).
>>> 6. Reboot device (newtmgr reset).
>>> 7. Make above change of loader permanent (newtmgr image confirm).
>>> 8. Upload new application to slot 1 (newtmgr image upload <filename>).
>>> 9. Tell device to "test out" the new application on next boot (newtmgr
>>>      image test <new-application-hash>).
>>> 10. Reboot device (newtmgr reset).
>>> 11. Make above change of application permanent (newtmgr image confirm).
>>>
>>> Steps 1 and 2 will leave the device in a state such that the app in slot
>>> 1 can be replaced.
>>>
>>> Chris
>>> .
>>>
> .
>


Re: image upload error 2

Posted by Christopher Collins <ch...@runtime.io>.
On Thu, Feb 23, 2017 at 06:05:44PM +0800, then yon wrote:
> Dear Chris,
> 
> Yes, i've followed the step you given; but after step 2 it gave me 
> "Error: Timeout reading from serial connection".
> 
> It only recover after i reset nrf52dk power and it show the result i 
> sent to you previously.
> 
> And when i tried to do step 1 again, it gave me "Error:  rc=6"

Is there anything you can do to preserve the newtmgr output in your
emails?  For some reason, the entire newtmgr response gets joined into a
single line, making it difficult to read.  I have reformatted the
responses below.

    $ newtmgr -c mynewt_serial image list
    Images:
      slot=0
        version: 1.0.0
        bootable: true
        flags: active confirmed
        hash: 6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c
      slot=1
        version: 1.0.0
        bootable: false
        flags:
        hash: 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b
    Split status: matching

The empty flags field in slot 1 indicates that the device is in
loader-only mode (i.e., only slot 0 is running).  It appears you have
completed step 3.  With slot 1 unused, you can overwrite it with a new
app.

    $ newtmgr -c mynewt_serial image test 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b
    Images:
      slot=0
        version: 1.0.0
        bootable: true
        flags: active confirmed
        hash: 6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c
      slot=1
        version: 1.0.0
        bootable: false
        flags: pending
        hash: 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b
    Split status: matching

The "test" command does not come until step 5.  What about step 4,
uploading the new loader?  By testing the original app image, you will
just put the device back into its original state.

    $ newtmgr -c mynewt_serial reset
    Done

    $ newtmgr -c mynewt_serial image list  ^C (cause it hang here indefinitely so i cancel it)

It seems like your app (slot 1) doesn't support newtmgr or lacks a
newtmgr transport.

    $ newtmgr -c mynewt_serial image upload splitty.img
    Error: Timeout reading from serial connection
    [...]

Which procedure are you following?  In the split upgrade procedure (the
one I pasted in my previous email), you only upload after issuing the
"image confirm" command.

Can you please do the following:

1. Tell me something about the target you are upgrading.  What loader
and app combo are you using?  From the above, it appears your app may
not support newtmgr.

2. Start from step 1 in the procedure I quoted, please indicate which
step you are currently on, and don't skip any steps :).

Thanks,
Chris

> 
> $ newtmgr -c mynewt_serial image list Images:  slot=0  version: 1.0.0 
> <http://1.0.0.0/> bootable: true  flags: active confirmed  hash: 
> 6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c  slot=1 
>   version: 1.0.0 <http://1.0.0.0/> bootable: false  flags: hash: 
> 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b  Split 
> status: matching $ newtmgr -c mynewt_serial image test 0fd 
> 6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b  Images: 
>   slot=0  version: 1.0.0 <http://1.0.0.0/> bootable: true  flags: active 
> confirmed  hash: 
> 6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c  slot=1 
>   version: 1.0.0 <http://1.0.0.0/> bootable: false  flags: pending 
>   hash: 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b 
>   Split status: matching $ newtmgr -c mynewt_serial reset  Done $ 
> newtmgr -c mynewt_serial image list  ^C (cause it hang here indefinitely 
> so i cancel it) $ newtmgr -c mynewt_serial image upload splitty.img 
> <http://plitty.img/>Error: Timeout reading from serial connection 
>   upload - Upload image to target  Usage:  newtmgr image upload [flags] 
>   Examples:  newtmgr -c olimex image upload <image_file  newtmgr -c 
> olimex image upload bin/slinky_zero/apps/slinky.img 
> <http://slinky.img/> Global Flags:  -c, --conn string connection profile 
> to use.  -l, --loglevel string log level to use (default INFO.) 
> <http://info.%29/>(default "info")  -t, --trace print all bytes 
> transmitted and received
> 
> 
> Thank you.
> 
> Regards,
> 
> Then Yoong Ze
> 
> 
> On 23/2/2017 12:44 AM, Christopher Collins wrote:
> > Hi Then,
> >
> > On Wed, Feb 22, 2017 at 02:11:36PM +0800, then yon wrote:
> >> Dear Support,
> >>
> >> I'm followed the tutorial below:
> >> https://mynewt.apache.org/latest/os/modules/split/split/
> >>
> >> But i'm stuck at image upload step; it gave me the following error:
> > [...]
> >> Error: Target error: 2
> > Error 2 indicates that there is no free slot for the new image.  In your
> > email, the "image list" output is a bit touch to read because it got
> > collapsed into a single line.  Here is my attempt to unravel it:
> >
> >> $ newtmgr -c mynewt_serial image list
> >> Images:
> >>      slot=0
> >>          version: 1.0.0
> >>          bootable: true
> >>          flags: active confirmed
> >>          hash: 493c5e78e76a9c1b9e574ab38b7bbf0d342d928ffd0111400dbe8c2c952da68e
> >>
> >>      slot=1
> >>          version: 1.0.0
> >>          bootable: false
> >>          flags: active confirmed
> >>          hash: 4d26a0d1596e12dab9059df3a13b4ffd54f96836cd9080d579c6afc167d58e81
> >>
> >>      Split status: matching
> > Notice that both slots have the "active" and "confirmed" flags set.
> > This indicates that both slots are currently running.  You need to run
> > the image in loader-only mode in order to replace the app in slot 1.
> > This is described in the "Image Upgrade - Split" section of the page you
> > linked to (https://mynewt.apache.org/latest/os/modules/split/split/).
> > Specifically:
> >
> >
> > 1. Disable split functionality; we need to deactivate the application
> >     image in slot 1 (newtmgr image test <current-loader-hash>).
> > 2. Reboot device (newtmgr reset).
> > 3. Make above change permanent (newtmgr image confirm).
> > 4. Upload new loader to slot 1 (newtmgr image upload <filename>).
> > 5. Tell device to "test out" the new loader on next boot (newtmgr image
> >     test <new-loader-hash>).
> > 6. Reboot device (newtmgr reset).
> > 7. Make above change of loader permanent (newtmgr image confirm).
> > 8. Upload new application to slot 1 (newtmgr image upload <filename>).
> > 9. Tell device to "test out" the new application on next boot (newtmgr
> >     image test <new-application-hash>).
> > 10. Reboot device (newtmgr reset).
> > 11. Make above change of application permanent (newtmgr image confirm).
> >
> > Steps 1 and 2 will leave the device in a state such that the app in slot
> > 1 can be replaced.
> >
> > Chris
> > .
> >
> 

Re: image upload error 2

Posted by then yon <yz...@free2move.se>.
Dear Chris,

Yes, i've followed the step you given; but after step 2 it gave me 
"Error: Timeout reading from serial connection".

It only recover after i reset nrf52dk power and it show the result i 
sent to you previously.

And when i tried to do step 1 again, it gave me "Error:  rc=6"

$ newtmgr -c mynewt_serial image list Images:  slot=0  version: 1.0.0 
<http://1.0.0.0/> bootable: true  flags: active confirmed  hash: 
6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c  slot=1 
  version: 1.0.0 <http://1.0.0.0/> bootable: false  flags: hash: 
0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b  Split 
status: matching $ newtmgr -c mynewt_serial image test 0fd 
6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b  Images: 
  slot=0  version: 1.0.0 <http://1.0.0.0/> bootable: true  flags: active 
confirmed  hash: 
6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c  slot=1 
  version: 1.0.0 <http://1.0.0.0/> bootable: false  flags: pending 
  hash: 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b 
  Split status: matching $ newtmgr -c mynewt_serial reset  Done $ 
newtmgr -c mynewt_serial image list  ^C (cause it hang here indefinitely 
so i cancel it) $ newtmgr -c mynewt_serial image upload splitty.img 
<http://plitty.img/>Error: Timeout reading from serial connection 
  upload - Upload image to target  Usage:  newtmgr image upload [flags] 
  Examples:  newtmgr -c olimex image upload <image_file  newtmgr -c 
olimex image upload bin/slinky_zero/apps/slinky.img 
<http://slinky.img/> Global Flags:  -c, --conn string connection profile 
to use.  -l, --loglevel string log level to use (default INFO.) 
<http://info.%29/>(default "info")  -t, --trace print all bytes 
transmitted and received


Thank you.

Regards,

Then Yoong Ze


On 23/2/2017 12:44 AM, Christopher Collins wrote:
> Hi Then,
>
> On Wed, Feb 22, 2017 at 02:11:36PM +0800, then yon wrote:
>> Dear Support,
>>
>> I'm followed the tutorial below:
>> https://mynewt.apache.org/latest/os/modules/split/split/
>>
>> But i'm stuck at image upload step; it gave me the following error:
> [...]
>> Error: Target error: 2
> Error 2 indicates that there is no free slot for the new image.  In your
> email, the "image list" output is a bit touch to read because it got
> collapsed into a single line.  Here is my attempt to unravel it:
>
>> $ newtmgr -c mynewt_serial image list
>> Images:
>>      slot=0
>>          version: 1.0.0
>>          bootable: true
>>          flags: active confirmed
>>          hash: 493c5e78e76a9c1b9e574ab38b7bbf0d342d928ffd0111400dbe8c2c952da68e
>>
>>      slot=1
>>          version: 1.0.0
>>          bootable: false
>>          flags: active confirmed
>>          hash: 4d26a0d1596e12dab9059df3a13b4ffd54f96836cd9080d579c6afc167d58e81
>>
>>      Split status: matching
> Notice that both slots have the "active" and "confirmed" flags set.
> This indicates that both slots are currently running.  You need to run
> the image in loader-only mode in order to replace the app in slot 1.
> This is described in the "Image Upgrade - Split" section of the page you
> linked to (https://mynewt.apache.org/latest/os/modules/split/split/).
> Specifically:
>
>
> 1. Disable split functionality; we need to deactivate the application
>     image in slot 1 (newtmgr image test <current-loader-hash>).
> 2. Reboot device (newtmgr reset).
> 3. Make above change permanent (newtmgr image confirm).
> 4. Upload new loader to slot 1 (newtmgr image upload <filename>).
> 5. Tell device to "test out" the new loader on next boot (newtmgr image
>     test <new-loader-hash>).
> 6. Reboot device (newtmgr reset).
> 7. Make above change of loader permanent (newtmgr image confirm).
> 8. Upload new application to slot 1 (newtmgr image upload <filename>).
> 9. Tell device to "test out" the new application on next boot (newtmgr
>     image test <new-application-hash>).
> 10. Reboot device (newtmgr reset).
> 11. Make above change of application permanent (newtmgr image confirm).
>
> Steps 1 and 2 will leave the device in a state such that the app in slot
> 1 can be replaced.
>
> Chris
> .
>


Re: image upload error 2

Posted by Christopher Collins <ch...@runtime.io>.
Hi Then,

On Wed, Feb 22, 2017 at 02:11:36PM +0800, then yon wrote:
> Dear Support,
> 
> I'm followed the tutorial below:
> https://mynewt.apache.org/latest/os/modules/split/split/
> 
> But i'm stuck at image upload step; it gave me the following error:
[...]
> Error: Target error: 2

Error 2 indicates that there is no free slot for the new image.  In your
email, the "image list" output is a bit touch to read because it got
collapsed into a single line.  Here is my attempt to unravel it:

> $ newtmgr -c mynewt_serial image list
> Images:
>     slot=0
>         version: 1.0.0 
>         bootable: true
>         flags: active confirmed
>         hash: 493c5e78e76a9c1b9e574ab38b7bbf0d342d928ffd0111400dbe8c2c952da68e
> 
>     slot=1 
>         version: 1.0.0
>         bootable: false
>         flags: active confirmed 
>         hash: 4d26a0d1596e12dab9059df3a13b4ffd54f96836cd9080d579c6afc167d58e81 
> 
>     Split status: matching

Notice that both slots have the "active" and "confirmed" flags set.
This indicates that both slots are currently running.  You need to run
the image in loader-only mode in order to replace the app in slot 1.
This is described in the "Image Upgrade - Split" section of the page you
linked to (https://mynewt.apache.org/latest/os/modules/split/split/).
Specifically:


1. Disable split functionality; we need to deactivate the application
   image in slot 1 (newtmgr image test <current-loader-hash>).
2. Reboot device (newtmgr reset).
3. Make above change permanent (newtmgr image confirm).
4. Upload new loader to slot 1 (newtmgr image upload <filename>).
5. Tell device to "test out" the new loader on next boot (newtmgr image
   test <new-loader-hash>).
6. Reboot device (newtmgr reset).
7. Make above change of loader permanent (newtmgr image confirm).
8. Upload new application to slot 1 (newtmgr image upload <filename>).
9. Tell device to "test out" the new application on next boot (newtmgr
   image test <new-application-hash>).
10. Reboot device (newtmgr reset).
11. Make above change of application permanent (newtmgr image confirm).

Steps 1 and 2 will leave the device in a state such that the app in slot
1 can be replaced.

Chris

Re: os_msys_get_pkthdr always return null

Posted by Christopher Collins <ch...@runtime.io>.
Hi Then,

On Wed, Feb 15, 2017 at 10:58:57AM +0800, then yon wrote:
> After i tried on 3 NRF52_DK board, 1 of it worked!
> 
> This is really weird as the other 2 units only work if i disabled the 
> filesystem.
> 
> Do you have any clue on this?

I wonder if the flash is corrupt somehow.  There were some
backwards-compatibility-breaking changes to the boot loader and flash
maps between 0.9.0 and 1.0.0-b2.  I would try erasing the flash entirely
on one of the boards, then upload the boot loader and image again.

I wouldn't expect these symptoms from flash corruption, though...

Chris

Changes in the filesystem on the lastest developer version

Posted by then yon <yz...@free2move.se>.
Dear Support,

Can i know that is the changes on the new filesystem?

We are working on esb project instead of ble; somehow after we update to 
latest developer version the esb part doesn't work anymore.

ps: By disabling the filesystem code it worked perfectly.

Thank you.

Regards,
Then Yoong Ze

image upload error 2

Posted by then yon <yz...@free2move.se>.
Dear Support,

I'm followed the tutorial below:
https://mynewt.apache.org/latest/os/modules/split/split/

But i'm stuck at image upload step; it gave me the following error:

$ newtmgr -c mynewt_serial image list Images: slot=0 version: 1.0.0 
<http://1.0.0.0/>bootable: true flags: active confirmed hash: 
493c5e78e76a9c1b9e574ab38b7bbf0d342d928ffd0111400dbe8c2c952da68e slot=1 
version: 1.0.0 <http://1.0.0.0/>bootable: false flags: active confirmed 
hash: 4d26a0d1596e12dab9059df3a13b4ffd54f96836cd9080d579c6afc167d58e81 
Split status: matching $ newtmgr -c mynewt_serial image upload s 
plitty.img <http://plitty.img/>Error: Target error: 2

Please help.

Thank you.

Regards,
Then Yoong Ze

Re: os_msys_get_pkthdr always return null

Posted by then yon <yz...@free2move.se>.
Dear Fabio,

Brilliant!!

It worked out just like you said.

Thank you very much.

Regards,

Then Yoong Ze


On 15/2/2017 1:03 PM, Fabio Utzig wrote:
> Hi,
>
> Are you running this os_msys_get_pkthdr code on the same thread that
> you're running the fsutil_write_file/fsutil_read_file?
>
> I'm pretty sure there is a bug on the fsutil functions (which was not
> triggered before) and I would suggest that you change temporarily both
> functions to remove (comment out) the calls to "fs_close" just after the
> "done:" label. The file in question is "fs/fs/src/fsutil.c".
>
> Please do this change and check if it solves your problem.
>
> Cheers,
> Fabio Utzig
>
> On Wed, Feb 15, 2017, at 12:58 AM, then yon wrote:
>> Dear Chris,
>>
>> After i tried on 3 NRF52_DK board, 1 of it worked!
>>
>> This is really weird as the other 2 units only work if i disabled the
>> filesystem.
>>
>> Do you have any clue on this?
>>
>> Regards,
>>
>> Then Yoong Ze
>>
>>
>> On 15/2/2017 6:32 AM, then yon wrote:
>>> Dear Chris,
>>>
>>> Thanks for your reply; i've made the changes below but i still get the
>>> same result.
>>>
>>> struct os_mbuf *om = os_msys_get_pkthdr(0, 0);
>>>
>>>      syscfg.vals:
>>>          MSYS_1_BLOCK_COUNT: 100
>>>      LOG_LEVEL: 1
>>>      SHELL_TASK: 1
>>>      SPI_0_SLAVE: 1
>>>      CONFIG_NFFS: 1
>>>
>>> For the nffs part, even it can build and run without error but it
>>> doesn't write/read from file system correctly. (I've sent another post
>>> on this)
>>>
>>> Thank you.
>>>
>>> Regards,
>>>
>>> Then Yoong Ze
>>>
>>>
>>> On 15/2/2017 12:48 AM, Christopher Collins wrote:
>>>> Hi Then,
>>>>
>>>> On Tue, Feb 14, 2017 at 06:35:35PM +0800, then yon wrote:
>>>>> Dear Support,
>>>>>
>>>>> I having issue with mqueue that the following code always return me
>>>>> error after i update myNewt to developer version.
>>>>>
>>>>> struct os_mbuf *om = os_msys_get_pkthdr(0, sizeof(some_struct));
>>>>>
>>>>> if(om == NULL)
>>>>> {
>>>>>        console_printf("Spi err 02\n");
>>>>>        return -2;
>>>>> }
>>>> I don't think this is the problem, but are you sure those arguments are
>>>> correct?  Most calls to os_msys_get_pkthdr() should specify 0 for the
>>>> second argument (user header length).
>>>>
>>>> You might just be out of mbufs.  You could try increasing the count of
>>>> mbufs allocated to msys by adding this to your target's syscfg.yml file:
>>>>
>>>>       syscfg.vals:
>>>>           MSYS_1_BLOCK_COUNT: 16
>>>>
>>>> This overrides the default value of 12 with 16.
>>>>
>>>>> By disabling nffs filesystem coding, it worked perfectly.
>>>> Hmm... I don't know of any connection between nffs and the behavior
>>>> you're seeing.  I don't believe nffs uses any mbufs.
>>>>
>>>> Chris
>>>> .
>>>>
> .
>


Re: os_msys_get_pkthdr always return null

Posted by Fabio Utzig <ut...@utzig.org>.
Hi,

Are you running this os_msys_get_pkthdr code on the same thread that
you're running the fsutil_write_file/fsutil_read_file?

I'm pretty sure there is a bug on the fsutil functions (which was not
triggered before) and I would suggest that you change temporarily both
functions to remove (comment out) the calls to "fs_close" just after the
"done:" label. The file in question is "fs/fs/src/fsutil.c".

Please do this change and check if it solves your problem.

Cheers,
Fabio Utzig

On Wed, Feb 15, 2017, at 12:58 AM, then yon wrote:
> Dear Chris,
> 
> After i tried on 3 NRF52_DK board, 1 of it worked!
> 
> This is really weird as the other 2 units only work if i disabled the 
> filesystem.
> 
> Do you have any clue on this?
> 
> Regards,
> 
> Then Yoong Ze
> 
> 
> On 15/2/2017 6:32 AM, then yon wrote:
> > Dear Chris,
> >
> > Thanks for your reply; i've made the changes below but i still get the 
> > same result.
> >
> > struct os_mbuf *om = os_msys_get_pkthdr(0, 0);
> >
> >     syscfg.vals:
> >         MSYS_1_BLOCK_COUNT: 100
> >     LOG_LEVEL: 1
> >     SHELL_TASK: 1
> >     SPI_0_SLAVE: 1
> >     CONFIG_NFFS: 1
> >
> > For the nffs part, even it can build and run without error but it 
> > doesn't write/read from file system correctly. (I've sent another post 
> > on this)
> >
> > Thank you.
> >
> > Regards,
> >
> > Then Yoong Ze
> >
> >
> > On 15/2/2017 12:48 AM, Christopher Collins wrote:
> >> Hi Then,
> >>
> >> On Tue, Feb 14, 2017 at 06:35:35PM +0800, then yon wrote:
> >>> Dear Support,
> >>>
> >>> I having issue with mqueue that the following code always return me
> >>> error after i update myNewt to developer version.
> >>>
> >>> struct os_mbuf *om = os_msys_get_pkthdr(0, sizeof(some_struct));
> >>>
> >>> if(om == NULL)
> >>> {
> >>>       console_printf("Spi err 02\n");
> >>>       return -2;
> >>> }
> >> I don't think this is the problem, but are you sure those arguments are
> >> correct?  Most calls to os_msys_get_pkthdr() should specify 0 for the
> >> second argument (user header length).
> >>
> >> You might just be out of mbufs.  You could try increasing the count of
> >> mbufs allocated to msys by adding this to your target's syscfg.yml file:
> >>
> >>      syscfg.vals:
> >>          MSYS_1_BLOCK_COUNT: 16
> >>
> >> This overrides the default value of 12 with 16.
> >>
> >>> By disabling nffs filesystem coding, it worked perfectly.
> >> Hmm... I don't know of any connection between nffs and the behavior
> >> you're seeing.  I don't believe nffs uses any mbufs.
> >>
> >> Chris
> >> .
> >>
> >
> 

Re: os_msys_get_pkthdr always return null

Posted by then yon <yz...@free2move.se>.
Dear Chris,

After i tried on 3 NRF52_DK board, 1 of it worked!

This is really weird as the other 2 units only work if i disabled the 
filesystem.

Do you have any clue on this?

Regards,

Then Yoong Ze


On 15/2/2017 6:32 AM, then yon wrote:
> Dear Chris,
>
> Thanks for your reply; i've made the changes below but i still get the 
> same result.
>
> struct os_mbuf *om = os_msys_get_pkthdr(0, 0);
>
>     syscfg.vals:
>         MSYS_1_BLOCK_COUNT: 100
>     LOG_LEVEL: 1
>     SHELL_TASK: 1
>     SPI_0_SLAVE: 1
>     CONFIG_NFFS: 1
>
> For the nffs part, even it can build and run without error but it 
> doesn't write/read from file system correctly. (I've sent another post 
> on this)
>
> Thank you.
>
> Regards,
>
> Then Yoong Ze
>
>
> On 15/2/2017 12:48 AM, Christopher Collins wrote:
>> Hi Then,
>>
>> On Tue, Feb 14, 2017 at 06:35:35PM +0800, then yon wrote:
>>> Dear Support,
>>>
>>> I having issue with mqueue that the following code always return me
>>> error after i update myNewt to developer version.
>>>
>>> struct os_mbuf *om = os_msys_get_pkthdr(0, sizeof(some_struct));
>>>
>>> if(om == NULL)
>>> {
>>>       console_printf("Spi err 02\n");
>>>       return -2;
>>> }
>> I don't think this is the problem, but are you sure those arguments are
>> correct?  Most calls to os_msys_get_pkthdr() should specify 0 for the
>> second argument (user header length).
>>
>> You might just be out of mbufs.  You could try increasing the count of
>> mbufs allocated to msys by adding this to your target's syscfg.yml file:
>>
>>      syscfg.vals:
>>          MSYS_1_BLOCK_COUNT: 16
>>
>> This overrides the default value of 12 with 16.
>>
>>> By disabling nffs filesystem coding, it worked perfectly.
>> Hmm... I don't know of any connection between nffs and the behavior
>> you're seeing.  I don't believe nffs uses any mbufs.
>>
>> Chris
>> .
>>
>


Re: os_msys_get_pkthdr always return null

Posted by then yon <yz...@free2move.se>.
Dear Chris,

Thanks for your reply; i've made the changes below but i still get the 
same result.

struct os_mbuf *om = os_msys_get_pkthdr(0, 0);

     syscfg.vals:
         MSYS_1_BLOCK_COUNT: 100
	LOG_LEVEL: 1
	SHELL_TASK: 1
	SPI_0_SLAVE: 1
	CONFIG_NFFS: 1

For the nffs part, even it can build and run without error but it doesn't write/read from file system correctly. (I've sent another post on this)

Thank you.

Regards,

Then Yoong Ze


On 15/2/2017 12:48 AM, Christopher Collins wrote:
> Hi Then,
>
> On Tue, Feb 14, 2017 at 06:35:35PM +0800, then yon wrote:
>> Dear Support,
>>
>> I having issue with mqueue that the following code always return me
>> error after i update myNewt to developer version.
>>
>> struct os_mbuf *om = os_msys_get_pkthdr(0, sizeof(some_struct));
>>
>> if(om == NULL)
>> {
>>       console_printf("Spi err 02\n");
>>       return -2;
>> }
> I don't think this is the problem, but are you sure those arguments are
> correct?  Most calls to os_msys_get_pkthdr() should specify 0 for the
> second argument (user header length).
>
> You might just be out of mbufs.  You could try increasing the count of
> mbufs allocated to msys by adding this to your target's syscfg.yml file:
>
>      syscfg.vals:
>          MSYS_1_BLOCK_COUNT: 16
>
> This overrides the default value of 12 with 16.
>
>> By disabling nffs filesystem coding, it worked perfectly.
> Hmm... I don't know of any connection between nffs and the behavior
> you're seeing.  I don't believe nffs uses any mbufs.
>
> Chris
> .
>


Re: os_msys_get_pkthdr always return null

Posted by Christopher Collins <ch...@runtime.io>.
Hi Then,

On Tue, Feb 14, 2017 at 06:35:35PM +0800, then yon wrote:
> Dear Support,
> 
> I having issue with mqueue that the following code always return me 
> error after i update myNewt to developer version.
> 
> struct os_mbuf *om = os_msys_get_pkthdr(0, sizeof(some_struct));
> 
> if(om == NULL)
> {
>      console_printf("Spi err 02\n");
>      return -2;
> }

I don't think this is the problem, but are you sure those arguments are
correct?  Most calls to os_msys_get_pkthdr() should specify 0 for the
second argument (user header length).

You might just be out of mbufs.  You could try increasing the count of
mbufs allocated to msys by adding this to your target's syscfg.yml file:

    syscfg.vals:
        MSYS_1_BLOCK_COUNT: 16

This overrides the default value of 12 with 16.

> By disabling nffs filesystem coding, it worked perfectly.

Hmm... I don't know of any connection between nffs and the behavior
you're seeing.  I don't believe nffs uses any mbufs.

Chris

Re: Getting Unhandled interrupt (17)

Posted by Wayne Keenan <wa...@gmail.com>.
Hi,

IRQ 17 is the Radio interrupt handler.
I think your implementing a new radio stack (?), e.g. not using Nimble, and may have just overlooked setting up that handler for your stack.

Regards
Wayne 

> On 10 Jan 2017, at 09:10, then yon <yz...@free2move.se> wrote:
> 
> Dear Fabio,
> 
> Sorry for the late response, have been interrupted by other task.
> 
> I have tried on your recommendation but it doesn't make any different.
> 
> Beside that the SWI0_EGU0_IRQHandler is a default peripheral interrupt handler defined in gcc_startup_nrf52.s (just like TIMER2_IRQHandler); it doesn't seem to be correct by defining it our-self.
> 
> Let me know if i understand it wrongly.
> 
> 
> Thank you.
> 
> Regards,
> 
> Then Yoong Ze
> 
> 
>> On 6/1/2017 6:04 PM, Fabio Utzig wrote:
>> Hi,
>> 
>> The unhandled exception is most probably caused by missing to define a
>> handler function. Before enabling the IRQ, try adding something like
>> (assuming the IRQ you want to handle is SWI0_EGU0_IRQ):
>> 
>> NVIC_SetVector(SWI0_EGU0_IRQn, (uint32_t) my_swi0_handler);
>> 
>> Att,
>> Fabio Utzig
>> 
>>> On Fri, Jan 6, 2017, at 05:02 AM, then yon wrote:
>>> Dear Support,
>>> 
>>> I was working on ESB mode in myNewt; what i did was porting the working
>>> code from my original working eclipse code.
>>> 
>>> Some how i was stuck at the ESB_EVT_IRQ(SWI0_EGU0_IRQ), whenever i
>>> enable this interrupt it gave me the following error when receiving
>>> packet from ESB:
>>> 1069: > Unhandled interrupt (17), exception sp 0x20001cf0 29711:
>>> r0:0x00000011 r1:0x00000001 r2:0x50000000 r3:0x00020000 29711:
>>> r4:0x000179c5 r5:0x00000001 r6:0x20001928 r7:0x00008171 29711:
>>> r8:0x00000000 r9:0x00000000 r10:0x20000000 r11:0x00000000
>>> 29711:r12:0x00000000 lr:0x000081a5 pc:0x0000819c psr:0x21000200
>>> 29711:ICSR:0x00421811 HFSR:0x00000000 CFSR:0x00000000
>>> 29711:BFAR:0xe000ed38 MMFAR:0xe000ed34
>>> 
>>> Can i know what is the meaning of that?
>>> 
>>> Please let me know if you need more info on this.
>>> 
>>> Thank you.
>>> 
>>> Regards,
>>> Then Yoong Ze
>> .
>> 
> 

os_msys_get_pkthdr always return null

Posted by then yon <yz...@free2move.se>.
Dear Support,

I having issue with mqueue that the following code always return me 
error after i update myNewt to developer version.

struct os_mbuf *om = os_msys_get_pkthdr(0, sizeof(some_struct));

if(om == NULL)
{
     console_printf("Spi err 02\n");
     return -2;
}

By disabling nffs filesystem coding, it worked perfectly.

Do anyone have any idea on this? Appreciate on your help.

Thank you.

Regards,
Then Yoong Ze

Re: Firmware update with MyNewt

Posted by then yon <yz...@free2move.se>.
Dear Jacob,

Thanks for your verification, so that means i need to use newtmgr for 
ota update.

I tried on newtmgr but i stuck when i tried to do something with the 
remote endpoint.

Here what i did:


Then it stuck there, it same for any other command that required 
interaction with remote endpoint.

My remote endpoint is nrf52dk board with bootloader and a working app 
loaded.

Another noob question here, how do i add a newtmge ota update conn? Is 
that add a ble conn?

Thank you.

Regards,

Then Yoong Ze


On 20/1/2017 11:45 PM, Jacob Rosenthal wrote:
> Im just working through this myself, so Im no authority here. But no as
> written newtmgr is where ota update lives currently
>
> On Fri, Jan 20, 2017 at 3:25 AM, then yon <yz...@free2move.se> wrote:
>
>> Dear Jacob,
>>
>> I working on OTA firmware upgrade, is there any method i can do without
>> going through newtmgr command?
>>
>> Thank you.
>>
>> Regards,
>>
>> Then Yoong Ze
>>
>>
>> On 18/1/2017 2:22 PM, Jacob Rosenthal wrote:
>>
>>> Youll find another thread (now poorly) titled "Single Bank firmware update
>>> (ie nordic vendor style dfu)" where Im getting a bunch of support on
>>> firmware updating on the nordic 16kbram target specifically.
>>>
>>> Split image is probably a really good link to read
>>> https://mynewt.apache.org/latest/os/modules/split/split/
>>>
>>> On Tue, Jan 17, 2017 at 11:07 PM, aditi hilbert <ad...@runtime.io> wrote:
>>>
>>> Then,
>>>> Have you taken a look at https://mynewt.apache.org/
>>>> latest/os/modules/bootloader/bootloader/ <https://mynewt.apache.org/
>>>> latest/os/modules/bootloader/bootloader/> ?
>>>>
>>>> thanks,
>>>> aditi
>>>>
>>>> On Jan 17, 2017, at 10:00 PM, then yon <yz...@free2move.se> wrote:
>>>>> Dear Support,
>>>>>
>>>>> I wish to workout with firmware update in mynewt platform.
>>>>>
>>>>> If i understand correctly the bootloader should able to do this, but i
>>>>>
>>>> cant found any documentation on this.
>>>>
>>>>> While i looking into bootloader coding, can you help to give me a
>>>>>
>>>> hint/guide to start with?
>>>>
>>>>> Appreciate on your help, this will save me lots of time.
>>>>>
>>>>> Thank you.
>>>>>
>>>>> Regards,
>>>>>
>>>>> Then Yoong Ze
>>>>>
>>>>


Re: Firmware update with MyNewt

Posted by Jacob Rosenthal <ja...@gmail.com>.
Im just working through this myself, so Im no authority here. But no as
written newtmgr is where ota update lives currently

On Fri, Jan 20, 2017 at 3:25 AM, then yon <yz...@free2move.se> wrote:

> Dear Jacob,
>
> I working on OTA firmware upgrade, is there any method i can do without
> going through newtmgr command?
>
> Thank you.
>
> Regards,
>
> Then Yoong Ze
>
>
> On 18/1/2017 2:22 PM, Jacob Rosenthal wrote:
>
>> Youll find another thread (now poorly) titled "Single Bank firmware update
>> (ie nordic vendor style dfu)" where Im getting a bunch of support on
>> firmware updating on the nordic 16kbram target specifically.
>>
>> Split image is probably a really good link to read
>> https://mynewt.apache.org/latest/os/modules/split/split/
>>
>> On Tue, Jan 17, 2017 at 11:07 PM, aditi hilbert <ad...@runtime.io> wrote:
>>
>> Then,
>>>
>>> Have you taken a look at https://mynewt.apache.org/
>>> latest/os/modules/bootloader/bootloader/ <https://mynewt.apache.org/
>>> latest/os/modules/bootloader/bootloader/> ?
>>>
>>> thanks,
>>> aditi
>>>
>>> On Jan 17, 2017, at 10:00 PM, then yon <yz...@free2move.se> wrote:
>>>>
>>>> Dear Support,
>>>>
>>>> I wish to workout with firmware update in mynewt platform.
>>>>
>>>> If i understand correctly the bootloader should able to do this, but i
>>>>
>>> cant found any documentation on this.
>>>
>>>> While i looking into bootloader coding, can you help to give me a
>>>>
>>> hint/guide to start with?
>>>
>>>> Appreciate on your help, this will save me lots of time.
>>>>
>>>> Thank you.
>>>>
>>>> Regards,
>>>>
>>>> Then Yoong Ze
>>>>
>>>
>>>
>

Re: Firmware update with MyNewt

Posted by then yon <yz...@free2move.se>.
Dear Jacob,

I working on OTA firmware upgrade, is there any method i can do without 
going through newtmgr command?

Thank you.

Regards,

Then Yoong Ze


On 18/1/2017 2:22 PM, Jacob Rosenthal wrote:
> Youll find another thread (now poorly) titled "Single Bank firmware update
> (ie nordic vendor style dfu)" where Im getting a bunch of support on
> firmware updating on the nordic 16kbram target specifically.
>
> Split image is probably a really good link to read
> https://mynewt.apache.org/latest/os/modules/split/split/
>
> On Tue, Jan 17, 2017 at 11:07 PM, aditi hilbert <ad...@runtime.io> wrote:
>
>> Then,
>>
>> Have you taken a look at https://mynewt.apache.org/
>> latest/os/modules/bootloader/bootloader/ <https://mynewt.apache.org/
>> latest/os/modules/bootloader/bootloader/> ?
>>
>> thanks,
>> aditi
>>
>>> On Jan 17, 2017, at 10:00 PM, then yon <yz...@free2move.se> wrote:
>>>
>>> Dear Support,
>>>
>>> I wish to workout with firmware update in mynewt platform.
>>>
>>> If i understand correctly the bootloader should able to do this, but i
>> cant found any documentation on this.
>>> While i looking into bootloader coding, can you help to give me a
>> hint/guide to start with?
>>> Appreciate on your help, this will save me lots of time.
>>>
>>> Thank you.
>>>
>>> Regards,
>>>
>>> Then Yoong Ze
>>


Re: Firmware update with MyNewt

Posted by Jacob Rosenthal <ja...@gmail.com>.
Youll find another thread (now poorly) titled "Single Bank firmware update
(ie nordic vendor style dfu)" where Im getting a bunch of support on
firmware updating on the nordic 16kbram target specifically.

Split image is probably a really good link to read
https://mynewt.apache.org/latest/os/modules/split/split/

On Tue, Jan 17, 2017 at 11:07 PM, aditi hilbert <ad...@runtime.io> wrote:

> Then,
>
> Have you taken a look at https://mynewt.apache.org/
> latest/os/modules/bootloader/bootloader/ <https://mynewt.apache.org/
> latest/os/modules/bootloader/bootloader/> ?
>
> thanks,
> aditi
>
> > On Jan 17, 2017, at 10:00 PM, then yon <yz...@free2move.se> wrote:
> >
> > Dear Support,
> >
> > I wish to workout with firmware update in mynewt platform.
> >
> > If i understand correctly the bootloader should able to do this, but i
> cant found any documentation on this.
> >
> > While i looking into bootloader coding, can you help to give me a
> hint/guide to start with?
> >
> > Appreciate on your help, this will save me lots of time.
> >
> > Thank you.
> >
> > Regards,
> >
> > Then Yoong Ze
>
>

Re: Firmware update with MyNewt

Posted by aditi hilbert <ad...@runtime.io>.
Then,

Have you taken a look at https://mynewt.apache.org/latest/os/modules/bootloader/bootloader/ <https://mynewt.apache.org/latest/os/modules/bootloader/bootloader/> ?

thanks,
aditi

> On Jan 17, 2017, at 10:00 PM, then yon <yz...@free2move.se> wrote:
> 
> Dear Support,
> 
> I wish to workout with firmware update in mynewt platform.
> 
> If i understand correctly the bootloader should able to do this, but i cant found any documentation on this.
> 
> While i looking into bootloader coding, can you help to give me a hint/guide to start with?
> 
> Appreciate on your help, this will save me lots of time.
> 
> Thank you.
> 
> Regards,
> 
> Then Yoong Ze


Firmware update with MyNewt

Posted by then yon <yz...@free2move.se>.
Dear Support,

I wish to workout with firmware update in mynewt platform.

If i understand correctly the bootloader should able to do this, but i 
cant found any documentation on this.

While i looking into bootloader coding, can you help to give me a 
hint/guide to start with?

Appreciate on your help, this will save me lots of time.

Thank you.

Regards,

Then Yoong Ze

Re: Getting Unhandled interrupt (17)

Posted by then yon <yz...@free2move.se>.
Dear Fabio,

Thanks for your help, it is working perfectly now.

The issues was both radio and swi handler missing.


Thank you very much for your help.

Regards,

Then Yoong Ze


On 10/1/2017 8:53 PM, Fabio Utzig wrote:
> On Tue, Jan 10, 2017, at 07:10 AM, then yon wrote:
>
>> Beside that the SWI0_EGU0_IRQHandler is a default peripheral interrupt
>> handler defined in gcc_startup_nrf52.s (just like TIMER2_IRQHandler); it
>> doesn't seem to be correct by defining it our-self.
> gcc_startup_nrf52.s defines weak symbols. You still have to overwrite
> them to handle something yourself. TIMER2 for example is handled on
> "hal_timer.c".
>
> I missed it before, but as Wayne mentioned, 17 is the RADIO handler. For
> BLE it is handled by ble_phy.c which you're probably not using, so you
> would need to define your own handler.
>
> Best,
> Fabio Utzig
> .
>


Re: Getting Unhandled interrupt (17)

Posted by Fabio Utzig <ut...@utzig.org>.
On Tue, Jan 10, 2017, at 07:10 AM, then yon wrote:

> Beside that the SWI0_EGU0_IRQHandler is a default peripheral interrupt 
> handler defined in gcc_startup_nrf52.s (just like TIMER2_IRQHandler); it 
> doesn't seem to be correct by defining it our-self.

gcc_startup_nrf52.s defines weak symbols. You still have to overwrite
them to handle something yourself. TIMER2 for example is handled on
"hal_timer.c".

I missed it before, but as Wayne mentioned, 17 is the RADIO handler. For
BLE it is handled by ble_phy.c which you're probably not using, so you
would need to define your own handler.

Best,
Fabio Utzig

Re: Getting Unhandled interrupt (17)

Posted by then yon <yz...@free2move.se>.
Dear Fabio,

Sorry for the late response, have been interrupted by other task.

I have tried on your recommendation but it doesn't make any different.

Beside that the SWI0_EGU0_IRQHandler is a default peripheral interrupt 
handler defined in gcc_startup_nrf52.s (just like TIMER2_IRQHandler); it 
doesn't seem to be correct by defining it our-self.

Let me know if i understand it wrongly.


Thank you.

Regards,

Then Yoong Ze


On 6/1/2017 6:04 PM, Fabio Utzig wrote:
> Hi,
>
> The unhandled exception is most probably caused by missing to define a
> handler function. Before enabling the IRQ, try adding something like
> (assuming the IRQ you want to handle is SWI0_EGU0_IRQ):
>
> NVIC_SetVector(SWI0_EGU0_IRQn, (uint32_t) my_swi0_handler);
>
> Att,
> Fabio Utzig
>
> On Fri, Jan 6, 2017, at 05:02 AM, then yon wrote:
>> Dear Support,
>>
>> I was working on ESB mode in myNewt; what i did was porting the working
>> code from my original working eclipse code.
>>
>> Some how i was stuck at the ESB_EVT_IRQ(SWI0_EGU0_IRQ), whenever i
>> enable this interrupt it gave me the following error when receiving
>> packet from ESB:
>> 1069: > Unhandled interrupt (17), exception sp 0x20001cf0 29711:
>> r0:0x00000011 r1:0x00000001 r2:0x50000000 r3:0x00020000 29711:
>> r4:0x000179c5 r5:0x00000001 r6:0x20001928 r7:0x00008171 29711:
>> r8:0x00000000 r9:0x00000000 r10:0x20000000 r11:0x00000000
>> 29711:r12:0x00000000 lr:0x000081a5 pc:0x0000819c psr:0x21000200
>> 29711:ICSR:0x00421811 HFSR:0x00000000 CFSR:0x00000000
>> 29711:BFAR:0xe000ed38 MMFAR:0xe000ed34
>>
>> Can i know what is the meaning of that?
>>
>> Please let me know if you need more info on this.
>>
>> Thank you.
>>
>> Regards,
>> Then Yoong Ze
> .
>


Re: Getting Unhandled interrupt (17)

Posted by Fabio Utzig <ut...@utzig.org>.
Hi,

The unhandled exception is most probably caused by missing to define a
handler function. Before enabling the IRQ, try adding something like
(assuming the IRQ you want to handle is SWI0_EGU0_IRQ):

NVIC_SetVector(SWI0_EGU0_IRQn, (uint32_t) my_swi0_handler);

Att,
Fabio Utzig

On Fri, Jan 6, 2017, at 05:02 AM, then yon wrote:
> Dear Support,
> 
> I was working on ESB mode in myNewt; what i did was porting the working 
> code from my original working eclipse code.
> 
> Some how i was stuck at the ESB_EVT_IRQ(SWI0_EGU0_IRQ), whenever i 
> enable this interrupt it gave me the following error when receiving 
> packet from ESB:
> 1069: > Unhandled interrupt (17), exception sp 0x20001cf0 29711: 
> r0:0x00000011 r1:0x00000001 r2:0x50000000 r3:0x00020000 29711: 
> r4:0x000179c5 r5:0x00000001 r6:0x20001928 r7:0x00008171 29711: 
> r8:0x00000000 r9:0x00000000 r10:0x20000000 r11:0x00000000 
> 29711:r12:0x00000000 lr:0x000081a5 pc:0x0000819c psr:0x21000200 
> 29711:ICSR:0x00421811 HFSR:0x00000000 CFSR:0x00000000 
> 29711:BFAR:0xe000ed38 MMFAR:0xe000ed34
> 
> Can i know what is the meaning of that?
> 
> Please let me know if you need more info on this.
> 
> Thank you.
> 
> Regards,
> Then Yoong Ze