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 2016/12/14 10:01:58 UTC

MYNEWT_VAL_STATS_CLI value cannot be change

Dear Support,

I been using MyNewt v1.0.0-dev, and i tried to enable statistic package 
for bletiny project so i can use the stat command.

What i did was following the tutorial below:

http://mynewt.apache.org/network/ble/ini_stack/ble_statpkg/

and i try to change MYNEWT_VAL_STATS_CLI to 1 by adding STATS_CLI: 1 to 
bletiny/syscfg.yml and -"@apache-mynewt-core/sys/stats" to bletiny/pkg.yml.

But after i build it doesn't change the MYNEWT_VAL_STATS_CLI at 
target/generated/include/syscfg/syscfg.h.

Please help if i missing some important step on this.

ps: stat command is working if i comment out #if MYNEWT_VAL(STATS_CLI)

Thank you.

Regards,

Then Yoong Ze


Re: how to use include path in myNewt

Posted by Sterling Hughes <st...@apache.org>.
Hi Then,

It may be useful to look at how we bundle chip vendor SDKs when looking 
at incorporating this project.

If there are an additional set of options that would help make this easy 
to work with newt, don’t hesitate to suggest them.  We want to make 
this easy.

Here is a pkg.yml file which specifies how to build the Nordic SDK:

https://github.com/runtimeinc/mynewt_nordic/blob/master/hw/mcu/nordic_sdk/pkg.yml

You can notice a few things:

pkg.type: sdk

Tells newt that this is an external SDK package.  When newt sees that, 
it looks in the src/ext directory of the package, and has a few rules:

1- Recurse all sub-directories of ext, and add them directly to the 
include path (allowing the include path to resolve.)

2- Recursively build all sub-directories of ext.

As you can see in the pkg.yml there are then additional rules you can 
apply to the complication, like which directories to build (if you 
don’t want to build all of ext/*, use pkg.src_dirs), and what types of 
files to ignore (ign_files) and what type of directory names to ignore 
(ign_dirs).

Hope this helps.  Again, if there are additional things you need to make 
this easier, let us know.  We can look at making newt work better for 
your scenario.

Best,

Sterling


On 21 Dec 2016, at 21:37, then yon wrote:

> Dear Support,
>
> Can i know how to use include path in myNewt?
>
> Currently i having an existing project that i wish to port into myNewt 
> platform; it will be a big hassle without include path feature.
>
> Thank you.
>
> Regards,
>
> Then Yoong Ze

how to use include path in myNewt

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

Can i know how to use include path in myNewt?

Currently i having an existing project that i wish to port into myNewt 
platform; it will be a big hassle without include path feature.

Thank you.

Regards,

Then Yoong Ze

Re: Problem Enabling The Console and Shell in blinky project

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

Thank you very much for the help.

I was able to enabled the shell for blinky project by:

1. Do the previous step mention in this email except this code:

     rc = console_init(NULL);
     assert(rc == 0);

2. Add a new task for shell

3. Declare struct os_eventq blinky_evq;

4. At main function: add os_eventq_init(&blinky_evq);

                                    add os_eventq_dflt_set(&blinky_evq);

5. at init_task function: add shell_init();

6. at shell_task_handler function : add os_eventq_run(&blinky_evq); 
inside while (1) loop.


Thanks again for your brilliant support.

Regards,

Then Yoong Ze


On 19/12/2016 9:32 PM, David G. Simmons wrote:
> Good morning,
>
> The difference between the bletiny program and the blinky program is that the bletiny program has an event queue defined and running, whereas the blinky program does not. Without a default event queue, there is no event queue available to handle shell commands. I suspect that the reason you are getting anythig at all is that you have local echo turned on in minicom, so you're simly seeing your text echoed back by minicom, not by mynewt.
>
> I guess I should add a short tutorial on adding the shell to blinky. In the meantime, you can work throiugh the http://mynewt.apache.org/latest/os/tutorials/tasks_lesson/ <http://mynewt.apache.org/latest/os/tutorials/tasks_lesson/> tutorial on how to add a task handler, or look in the bletiny source code for how the default task handler is instantiated.
>
> Best regards,
> dg
>
>> On Dec 19, 2016, at 3:50 AM, then yon <yz...@free2move.se> wrote:
>>
>> Dear Support,
>>
>> After successfully enabled the console and shell in bletiny project; i used the same method with blinky project but the console only echo back the word i typed without any other response. (LED blinking worked as it should)
>>
>> I have attached output.png, main.c, pkg.yml and syscfg.yml. Changes made as followed:
>> 1. pkg.yml - added "@apache-mynewt-core/sys/console/full"
>>                                  "@apache-mynewt-core/sys/shell"
>>                                  "@apache-mynewt-core/sys/sysinit"
>> 2. main.c - added  #include "console/console.h"
>>                                 #include "shell/shell.h"
>>                                 #include "syscfg/syscfg.h"
>>
>>                                 rc = console_init(NULL);
>>                                 assert(rc == 0);
>> 3. syscfg.yml - Added
>> #Package: apps/bletiny
>> syscfg.vals:
>>     # Enable the shell task.
>>     SHELL_TASK: 1
>>
>>     CONSOLE_TICKS: 1
>>     CONSOLE_PROMPT: 1
>>
>> Please let me know is there any important initializing step i missed out.
>>
>> Thank you.
>>
>> Regards,
>>
>> Then Yoong Ze
>> <pkg.yml><syscfg.yml><main.c>
> --
> David G. Simmons
> (919) 534-5099
> Web <https://davidgs.com/> \u2022 Blog <https://davidgs.com/davidgs_blog> \u2022 Linkedin <http://linkedin.com/in/davidgsimmons> \u2022 Twitter <http://twitter.com/TechEvangelist1> \u2022 GitHub <http://github.com/davidgs>
> /** Message digitally signed for security and authenticity.
> * If you cannot read the PGP.sig attachment, please go to
>   * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
>   * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
> **/
> \u267a This email uses 100% recycled electrons. Don't blow it by printing!
>
> There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.
>
>
>


Re: Problem Enabling The Console and Shell in blinky project

Posted by "David G. Simmons" <sa...@mac.com>.
Good morning,

The difference between the bletiny program and the blinky program is that the bletiny program has an event queue defined and running, whereas the blinky program does not. Without a default event queue, there is no event queue available to handle shell commands. I suspect that the reason you are getting anythig at all is that you have local echo turned on in minicom, so you're simly seeing your text echoed back by minicom, not by mynewt. 

I guess I should add a short tutorial on adding the shell to blinky. In the meantime, you can work throiugh the http://mynewt.apache.org/latest/os/tutorials/tasks_lesson/ <http://mynewt.apache.org/latest/os/tutorials/tasks_lesson/> tutorial on how to add a task handler, or look in the bletiny source code for how the default task handler is instantiated. 

Best regards,
dg

> On Dec 19, 2016, at 3:50 AM, then yon <yz...@free2move.se> wrote:
> 
> Dear Support,
> 
> After successfully enabled the console and shell in bletiny project; i used the same method with blinky project but the console only echo back the word i typed without any other response. (LED blinking worked as it should)
> 
> I have attached output.png, main.c, pkg.yml and syscfg.yml. Changes made as followed:
> 1. pkg.yml - added "@apache-mynewt-core/sys/console/full"
>                                 "@apache-mynewt-core/sys/shell"
>                                 "@apache-mynewt-core/sys/sysinit"
> 2. main.c - added  #include "console/console.h"
>                                #include "shell/shell.h"
>                                #include "syscfg/syscfg.h"
> 
>                                rc = console_init(NULL);
>                                assert(rc == 0);
> 3. syscfg.yml - Added
> #Package: apps/bletiny
> syscfg.vals:
>    # Enable the shell task.
>    SHELL_TASK: 1
> 
>    CONSOLE_TICKS: 1
>    CONSOLE_PROMPT: 1
> 
> Please let me know is there any important initializing step i missed out.
> 
> Thank you.
> 
> Regards,
> 
> Then Yoong Ze
> <pkg.yml><syscfg.yml><main.c>

--
David G. Simmons
(919) 534-5099
Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
/** Message digitally signed for security and authenticity.  
* If you cannot read the PGP.sig attachment, please go to 
 * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
 * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
**/
♺ This email uses 100% recycled electrons. Don't blow it by printing!

There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.



Problem Enabling The Console and Shell in blinky project

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

After successfully enabled the console and shell in bletiny project; i 
used the same method with blinky project but the console only echo back 
the word i typed without any other response. (LED blinking worked as it 
should)

I have attached output.png, main.c, pkg.yml and syscfg.yml. Changes made 
as followed:
1. pkg.yml - added "@apache-mynewt-core/sys/console/full"
                                  "@apache-mynewt-core/sys/shell"
                                  "@apache-mynewt-core/sys/sysinit"
2. main.c - added  #include "console/console.h"
                                 #include "shell/shell.h"
                                 #include "syscfg/syscfg.h"

                                 rc = console_init(NULL);
                                 assert(rc == 0);
3. syscfg.yml - Added
#Package: apps/bletiny
syscfg.vals:
     # Enable the shell task.
     SHELL_TASK: 1

     CONSOLE_TICKS: 1
     CONSOLE_PROMPT: 1

Please let me know is there any important initializing step i missed out.

Thank you.

Regards,

Then Yoong Ze

Re: MyNewt Mqueue not working

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

Thank you very much.

Have a nice day.

Regards,

Then Yoong Ze


On 4/1/2017 3:45 AM, Christopher Collins wrote:
> Hi Then,
>
> On Tue, Jan 03, 2017 at 02:47:44PM +0800, then yon wrote:
>> Beside this, i have a question on the os_msys_get_pkthdr function
>> parameters; because no matter how i changed the param doesn't make any
>> changes to the result and by looking into some examples eg:
>> Ble_adaptor.c it just put m = os_msys_get_pkthdr(0, 0) ;
>>
>> Can you elaborate more on this so i know how to assign the values to it.
> Msys is documented fairly well here:
> http://mynewt.apache.org/latest/os/core_os/msys/msys
>
> I didn't know we had msys documentation until just now, so don't feel
> bad if you didn't either :).
>
> The os_msys_get functions have slightly odd semantics, but I think that
> page does a pretty good job of explaining it.  Please just shout if
> something doesn't make sense.
>
> Regarding the usrhdr_len parameter (second parameter) - I think this
> page does a good job of explaining what an mbuf user header is:
> http://mynewt.apache.org/latest/os/core_os/mbuf/mbuf .  The general rule
> is: if you aren't sure, just specify 0.
>
> Thanks,
> Chris
> .
>


Re: MyNewt Mqueue not working

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

On Tue, Jan 03, 2017 at 02:47:44PM +0800, then yon wrote:
> Beside this, i have a question on the os_msys_get_pkthdr function 
> parameters; because no matter how i changed the param doesn't make any 
> changes to the result and by looking into some examples eg: 
> Ble_adaptor.c it just put m = os_msys_get_pkthdr(0, 0) ;
> 
> Can you elaborate more on this so i know how to assign the values to it.

Msys is documented fairly well here:
http://mynewt.apache.org/latest/os/core_os/msys/msys

I didn't know we had msys documentation until just now, so don't feel
bad if you didn't either :).

The os_msys_get functions have slightly odd semantics, but I think that
page does a pretty good job of explaining it.  Please just shout if
something doesn't make sense.

Regarding the usrhdr_len parameter (second parameter) - I think this
page does a good job of explaining what an mbuf user header is:
http://mynewt.apache.org/latest/os/core_os/mbuf/mbuf .  The general rule
is: if you aren't sure, just specify 0.

Thanks,
Chris

Re: MyNewt Mqueue not working

Posted by Kevin Townsend <ke...@adafruit.com>.
I had a similar problem last week trying to understand the callbacks 
with events queues, but perhaps the following sample code I put together 
will clarify something. It uses the second approach mentioned by Chris, 
which is a dedicated processing task for the event queues so that I know 
the priority level the events will be executed within.

This code sets up a HW interrupt on a GPIO pin, and when we enter the 
interrupt service routine we add an event to the eventq. This event is 
handled outside the ISR context at a later less critical time. It just 
does blinky now which could be safely done inside the ISR, of course, 
but it's a useful real world example of when you would want to use event 
queues in my opinion to get in and out of the ISR as quickly as possible.

Kevin

#include "os/os.h"
#include "bsp/bsp.h"
#include "hal/hal_gpio.h"
#include <assert.h>
#include <string.h>
#ifdef ARCH_sim
#include <mcu/mcu_sim.h>
#endif

#define IRQ_PIN             (20)
#define EVENT_TASK_PRIO     (1)
#define EVENT_STACK_SIZE    OS_STACK_ALIGN(128)

struct os_task event_task;
os_stack_t event_stack[EVENT_STACK_SIZE];
static struct os_eventq irq_evq;

static int init_tasks(void);
static void gpio_task_irq_deferred_handler(struct os_event *);

static struct os_event gpio_irq_handle_event = {
     .ev_cb = gpio_task_irq_deferred_handler,
};

/**
  * This function will be called when the gpio_irq_handle_event is pulled
  * from the message queue.
  */
static void
gpio_task_irq_deferred_handler(struct os_event *ev)
{
     hal_gpio_toggle(LED_2);
}

/**
  * This task serves as a container for the shell and newtmgr packages.  
These
  * packages enqueue timer events when they need this task to do work.
  */
static void
event_task_handler(void *arg)
{
     while (1) {
         os_eventq_run(&irq_evq);
     }
}

/**
  * This function handles the HW GPIO interrupt and registers an event in
  * the event queue to defer taking action here in the ISR context.
  */
static void
gpio_irq_handler(void *arg)
{
     /* Add item to event queue for processing later, etc. ... */
     os_eventq_put(&irq_evq, &gpio_irq_handle_event);
}

/**
  * init_tasks
  *
  * Called by main.c after os_init(). This function performs initializations
  * that are required before tasks are running.
  *
  * @return int 0 success; error otherwise.
  */
static int
init_tasks(void)
{
     /* Init IRQ pin: falling edge, pullup enabled */
     hal_gpio_irq_init(IRQ_PIN,
                       gpio_irq_handler,
                       NULL,
                       HAL_GPIO_TRIG_FALLING,
                       HAL_GPIO_PULL_UP);

     /* Enable the IRQ */
     hal_gpio_irq_enable(IRQ_PIN);

     /* Setup the LED pins */
     hal_gpio_init_out(LED_BLINK_PIN, 1);
     hal_gpio_init_out(LED_2, 0);

     os_task_init(&event_task, "irq", event_task_handler, NULL,
             EVENT_TASK_PRIO, OS_WAIT_FOREVER, event_stack, 
EVENT_STACK_SIZE);

     os_eventq_init(&irq_evq);
     os_eventq_dflt_set(&irq_evq);

     return 0;
}

/**
  * main
  *
  * The main function for the project. This function initializes the os, 
calls
  * init_tasks to initialize tasks (and possibly other objects), then 
starts the
  * OS. We should not return from os start.
  *
  * @return int NOTE: this function should never return!
  */
int
main(int argc, char **argv)
{
     int rc;

#ifdef ARCH_sim
     mcu_sim_parse_args(argc, argv);
#endif

     os_init();

     rc = init_tasks();
     os_start();

     /* os start should never return. If it does, this should be an error */
     assert(0);

     return rc;
}


On 02/01/17 11:26, then yon wrote:
> Dear Chris,
>
> I tried to apply your solution but i stuck somewhere in middle as the 
> handler parameter is diff that cause build error
>
> void shell_task_handler(void *arg)
> static void queue_task_handler(struct os_event *ev)
>
> 1. At os_eventq_init(&shell_task_evq);
>
> 2. At os_task_init(&queue_task, "queue", queue_task_handler, NULL, 
> QUEUE_TASK_PRIO, OS_WAIT_FOREVER, queue_stack, QUEUE_STACK_SIZE);
>
>
> Thank you for your fast response and happy new year.
>
> Regards,
> Then Yoong Ze
>
> On 2/1/2017 2:25 PM, Christopher Collins wrote:
>> Hi Then,
>>
>> On Mon, Jan 02, 2017 at 01:23:33PM +0800, then yon wrote:
>>> Dear Support,
>>>
>>> I been using MyNewt v1.0.0-dev, and i tried to make use of Mqueue.
>>>
>>> What i did was following the tutorial below:
>>>
>>> https://mynewt.apache.org/os/core_os/mqueue/mqueue/
>>> Since the tutorial is not updated, i tried to modify it but 
>>> unfortunately i can't make it work.
>> [...]
>>
>> Your code looks good.  There is just one crucial step missing: a task
>> needs to poll the eventq you created (queue_task_evq).  Just to clarify
>> how mqueues work: when os_mqueue_put() is called, two things happen:
>>      1. The specified mbuf is placed on the mqueue.
>>      2. The event associated with the mqueue is put on the specified
>>         eventq, but only if the event is not already enqueued.
>>
>> If a task is listening on the eventq, then it can your mqueue processing
>> function when it sees the mqueue event.
>>
>> I think you have two options:
>>      1. Remove queue_task_evq from your code; use the other eventq
>>         (blinky_evq) with your mqueue.  blinky_evq is already being
>>         processed correctly by the shell_task_handler() function, so if
>>         you enqueue an mqueue event to it, your mqueue data will get
>>         processed.
>>
>>      2. Create an additional task which processes the queue_task_evq
>>         eventq.  This task's handler would probably look identical to
>>         shell_task_handler(), i.e., a tight loop that repeatedly calls
>>         os_eventq_run().
>>
>> I recommend trying the simpler option 1 first.  Generally, it is best to
>> minimize the number of tasks your app uses so that it requires less RAM.
>>
>> Thanks,
>> Chris
>> .
>>
>
>


Re: MyNewt Mqueue not working

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

Brilliant! It worked perfectly.

Beside this, i have a question on the os_msys_get_pkthdr function 
parameters; because no matter how i changed the param doesn't make any 
changes to the result and by looking into some examples eg: 
Ble_adaptor.c it just put m = os_msys_get_pkthdr(0, 0) ;

Can you elaborate more on this so i know how to assign the values to it.


Thank you very much.

Regards,

Then Yoong Ze


On 3/1/2017 6:18 AM, Christopher Collins wrote:
> Hi Then,
>
> On Mon, Jan 02, 2017 at 06:26:05PM +0800, then yon wrote:
>> Dear Chris,
>>
>> I tried to apply your solution but i stuck somewhere in middle as the
>> handler parameter is diff that cause build error
>>
>> void shell_task_handler(void *arg)
>> static void queue_task_handler(struct os_event *ev)
>>
>> 1. At os_eventq_init(&shell_task_evq);
>>
>> 2. At os_task_init(&queue_task, "queue", queue_task_handler, NULL,
>> QUEUE_TASK_PRIO, OS_WAIT_FOREVER, queue_stack, QUEUE_STACK_SIZE);
> I have attached a copy of main.c which incorporates the "option 1" that
> I mentioned in my last email.  I also had to make a few other changes to
> successfully test this change.  I will briefly describe them below.
>
> 1. Rename shell_{task,stack,etc.} to data_[...].  This is probably just
> to scratch an OCD itch, but I had a hard time with this because the
> shell task wasn't actually related to the shell.
>
> 2. Don't perform 1,000,000 GPIO writes upfront.  When I tested this in
> sim, the GPIO writes were taking too long.  Since the work task has the
> highest priority, this means the mqueue operations never took place.
> This could just be a sim thing, though, since sim calls printf on each
> GPIO set.
>
> 3. Don't allocate the mbuf on the stack; get it from
> os_msys_get_pkthdr() instead.  This change is analogous to changing a
> variable from being automatic (stack) to dynamic via a call to malloc().
> It is important that the mbuf is dynamic because:
>      * It is passed to a different task, so when it gets processed, the
>        original stack's contents are lost.
>      * It gets freed via a call to os_mbuf_free_chain().  When you try to
>        free an mbuf on the stack, you will get a very confusing crash
>        that will take all day to debug.  I'm afraid I know this from
>        experience :).
>
> 4. Don't call shell_init() explicitly.  The shell package gets
> initialized automatically by the sysinit mechanism.
>
> 5. The changes I mentioned earlier:
>      * Remove the queue_task_evq
>      * Associate the mqueue with blinky_evq (used to be queue_task_evq).
>
> Thanks,
> Chris


Re: MyNewt Mqueue not working

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

On Mon, Jan 02, 2017 at 06:26:05PM +0800, then yon wrote:
> Dear Chris,
> 
> I tried to apply your solution but i stuck somewhere in middle as the 
> handler parameter is diff that cause build error
> 
> void shell_task_handler(void *arg)
> static void queue_task_handler(struct os_event *ev)
> 
> 1. At os_eventq_init(&shell_task_evq);
> 
> 2. At os_task_init(&queue_task, "queue", queue_task_handler, NULL, 
> QUEUE_TASK_PRIO, OS_WAIT_FOREVER, queue_stack, QUEUE_STACK_SIZE);

I have attached a copy of main.c which incorporates the "option 1" that
I mentioned in my last email.  I also had to make a few other changes to
successfully test this change.  I will briefly describe them below.

1. Rename shell_{task,stack,etc.} to data_[...].  This is probably just
to scratch an OCD itch, but I had a hard time with this because the
shell task wasn't actually related to the shell.

2. Don't perform 1,000,000 GPIO writes upfront.  When I tested this in
sim, the GPIO writes were taking too long.  Since the work task has the
highest priority, this means the mqueue operations never took place.
This could just be a sim thing, though, since sim calls printf on each
GPIO set.

3. Don't allocate the mbuf on the stack; get it from
os_msys_get_pkthdr() instead.  This change is analogous to changing a
variable from being automatic (stack) to dynamic via a call to malloc().
It is important that the mbuf is dynamic because:
    * It is passed to a different task, so when it gets processed, the
      original stack's contents are lost.
    * It gets freed via a call to os_mbuf_free_chain().  When you try to
      free an mbuf on the stack, you will get a very confusing crash
      that will take all day to debug.  I'm afraid I know this from
      experience :).

4. Don't call shell_init() explicitly.  The shell package gets
initialized automatically by the sysinit mechanism.

5. The changes I mentioned earlier:
    * Remove the queue_task_evq
    * Associate the mqueue with blinky_evq (used to be queue_task_evq).

Thanks,
Chris

Re: MyNewt Mqueue not working

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

I tried to apply your solution but i stuck somewhere in middle as the 
handler parameter is diff that cause build error

void shell_task_handler(void *arg)
static void queue_task_handler(struct os_event *ev)

1. At os_eventq_init(&shell_task_evq);

2. At os_task_init(&queue_task, "queue", queue_task_handler, NULL, 
QUEUE_TASK_PRIO, OS_WAIT_FOREVER, queue_stack, QUEUE_STACK_SIZE);


Thank you for your fast response and happy new year.

Regards,
Then Yoong Ze

On 2/1/2017 2:25 PM, Christopher Collins wrote:
> Hi Then,
>
> On Mon, Jan 02, 2017 at 01:23:33PM +0800, then yon wrote:
>> Dear Support,
>>
>> I been using MyNewt v1.0.0-dev, and i tried to make use of Mqueue.
>>
>> What i did was following the tutorial below:
>>
>> https://mynewt.apache.org/os/core_os/mqueue/mqueue/
>> Since the tutorial is not updated, i tried to modify it but unfortunately i can't make it work.
> [...]
>
> Your code looks good.  There is just one crucial step missing: a task
> needs to poll the eventq you created (queue_task_evq).  Just to clarify
> how mqueues work: when os_mqueue_put() is called, two things happen:
>      1. The specified mbuf is placed on the mqueue.
>      2. The event associated with the mqueue is put on the specified
>         eventq, but only if the event is not already enqueued.
>
> If a task is listening on the eventq, then it can your mqueue processing
> function when it sees the mqueue event.
>
> I think you have two options:
>      1. Remove queue_task_evq from your code; use the other eventq
>         (blinky_evq) with your mqueue.  blinky_evq is already being
>         processed correctly by the shell_task_handler() function, so if
>         you enqueue an mqueue event to it, your mqueue data will get
>         processed.
>
>      2. Create an additional task which processes the queue_task_evq
>         eventq.  This task's handler would probably look identical to
>         shell_task_handler(), i.e., a tight loop that repeatedly calls
>         os_eventq_run().
>
> I recommend trying the simpler option 1 first.  Generally, it is best to
> minimize the number of tasks your app uses so that it requires less RAM.
>
> Thanks,
> Chris
> .
>


Re: MyNewt Mqueue not working

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

On Mon, Jan 02, 2017 at 01:23:33PM +0800, then yon wrote:
> Dear Support,
> 
> I been using MyNewt v1.0.0-dev, and i tried to make use of Mqueue.
> 
> What i did was following the tutorial below:
> 
> https://mynewt.apache.org/os/core_os/mqueue/mqueue/
> Since the tutorial is not updated, i tried to modify it but unfortunately i can't make it work.

[...]

Your code looks good.  There is just one crucial step missing: a task
needs to poll the eventq you created (queue_task_evq).  Just to clarify
how mqueues work: when os_mqueue_put() is called, two things happen:
    1. The specified mbuf is placed on the mqueue.
    2. The event associated with the mqueue is put on the specified
       eventq, but only if the event is not already enqueued.

If a task is listening on the eventq, then it can your mqueue processing
function when it sees the mqueue event.

I think you have two options:
    1. Remove queue_task_evq from your code; use the other eventq
       (blinky_evq) with your mqueue.  blinky_evq is already being
       processed correctly by the shell_task_handler() function, so if
       you enqueue an mqueue event to it, your mqueue data will get
       processed.

    2. Create an additional task which processes the queue_task_evq
       eventq.  This task's handler would probably look identical to
       shell_task_handler(), i.e., a tight loop that repeatedly calls
       os_eventq_run().

I recommend trying the simpler option 1 first.  Generally, it is best to
minimize the number of tasks your app uses so that it requires less RAM.

Thanks,
Chris

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

Getting Unhandled interrupt (17)

Posted by then yon <yz...@free2move.se>.
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

MyNewt Mqueue not working

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

I been using MyNewt v1.0.0-dev, and i tried to make use of Mqueue.

What i did was following the tutorial below:

https://mynewt.apache.org/os/core_os/mqueue/mqueue/
Since the tutorial is not updated, i tried to modify it but unfortunately i can't make it work.

Below are what i have done on Mqueue: (the main.c file is attached)
1. initialize Mqueue and eventq:
	
     /* Initialize eventq */
     os_eventq_init(&queue_task_evq);

     /* Initialize mqueue */
     os_mqueue_init(&rxpkt_q, &queue_task_handler, NULL);
2. Add queue_task_handler to process the data received:

void process_rx_data_queue(void)
{
     int i;
     struct os_mbuf *om;

     /* Drain all packets off queue and process them */
     while ((om = os_mqueue_get(&rxpkt_q)) != NULL) {
         const uint8_t *data = om->om_data;
         int temp_len = om->om_len;
         console_printf("Data get: ");
         for(i=0; i<temp_len; i++)
             console_printf("%02X ", *data++);
         console_printf("\n\r");

         os_mbuf_free_chain(om);
     }
}

static void queue_task_handler(struct os_event *ev)
{
     struct os_mbuf *m_resp;
     while ((m_resp = os_mqueue_get(&rxpkt_q)) != NULL)  {
         process_rx_data_queue();
     }
}

3. Put some data into the queue:

         /* Put data into mbuf */
         struct os_mbuf *om;
         memset(&om,0, sizeof(om));
         uint8_t temp_data[5];
         temp_data[0] = i;
         om->om_data = temp_data;
         om->om_len = 1;

         queue_task_rx_data_func(om);


int queue_task_rx_data_func(struct os_mbuf *om)
{
     int rc;

     rc = os_mqueue_put(&rxpkt_q, &queue_task_evq, om);
     if (rc != 0) {
         return -1;
     }

     return 0;
}

Please help me on anything i miss out or done wrongly.

Thank you very much.

Regards,

Then Yoong Ze



Re: MyNewt NRF52 enhanced shockburst

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

Thank you very much.

Regards,

Then Yoong Ze


On 16/12/2016 9:26 PM, David G. Simmons wrote:
> At a first glance of the ESB, you'd have to do a fair amount of work to replace the nimBLE stack with the ESB stack, but it looks like at least soe of the work might be done via the micro-esb library at https://github.com/NordicSemiconductor/nrf51-micro-esb <https://github.com/NordicSemiconductor/nrf51-micro-esb> That's for the NRF51 though, so there's probably some work involved in getting that cleaned up for nrf52, maybe.
>
> Let us know how it goes!
>
> dg
>
>> On Dec 15, 2016, at 11:38 PM, then yon <yz...@free2move.se> wrote:
>>
>> Dear Support,
>>
>> Currently i'm working on NRF52 dev; and i wish to make use of the enhanced shockburst feature.
>>
>> Is there anyway i can do that? Please give me some hint for me to start with.
>>
>> Thank you.
>>
>> Regards,
>>
>> Then Yoong Ze
> --
> David G. Simmons
> (919) 534-5099
> Web <https://davidgs.com/> \u2022 Blog <https://davidgs.com/davidgs_blog> \u2022 Linkedin <http://linkedin.com/in/davidgsimmons> \u2022 Twitter <http://twitter.com/TechEvangelist1> \u2022 GitHub <http://github.com/davidgs>
> /** Message digitally signed for security and authenticity.
> * If you cannot read the PGP.sig attachment, please go to
>   * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
>   * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
> **/
> \u267a This email uses 100% recycled electrons. Don't blow it by printing!
>
> There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.
>
>
>


Re: MyNewt NRF52 enhanced shockburst

Posted by "David G. Simmons" <sa...@mac.com>.
At a first glance of the ESB, you'd have to do a fair amount of work to replace the nimBLE stack with the ESB stack, but it looks like at least soe of the work might be done via the micro-esb library at https://github.com/NordicSemiconductor/nrf51-micro-esb <https://github.com/NordicSemiconductor/nrf51-micro-esb> That's for the NRF51 though, so there's probably some work involved in getting that cleaned up for nrf52, maybe. 

Let us know how it goes!

dg

> On Dec 15, 2016, at 11:38 PM, then yon <yz...@free2move.se> wrote:
> 
> Dear Support,
> 
> Currently i'm working on NRF52 dev; and i wish to make use of the enhanced shockburst feature.
> 
> Is there anyway i can do that? Please give me some hint for me to start with.
> 
> Thank you.
> 
> Regards,
> 
> Then Yoong Ze

--
David G. Simmons
(919) 534-5099
Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
/** Message digitally signed for security and authenticity.  
* If you cannot read the PGP.sig attachment, please go to 
 * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
 * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
**/
♺ This email uses 100% recycled electrons. Don't blow it by printing!

There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.



MyNewt NRF52 enhanced shockburst

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

Currently i'm working on NRF52 dev; and i wish to make use of the 
enhanced shockburst feature.

Is there anyway i can do that? Please give me some hint for me to start 
with.

Thank you.

Regards,

Then Yoong Ze

Re: MYNEWT_VAL_STATS_CLI value cannot be change

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

My issue solved by yours suggestion by:

1. Create syscfg.yml under targets/target_name/

2. Copy following code into the file:

#Package: apps/bletiny
syscfg.vals:
# Enable the shell task.
SHELL_TASK: 1
# Set log level to info (disable debug logging).
LOG_LEVEL: 1
# Disable security manager (pairing and bonding).
BLE_SM: 0
# Disable eddystone beacons.
BLE_EDDYSTONE: 0
# Enable stats.
STATS_CLI: 1

3. Remove syscfg.yml under apps/app_name/

PS: as per dg said current version no need to add stats_module_init(); 
and as per Chris said no need to add "@apache-mynewt-core/sys/stats" 
dependency.


Thank you so much for yours brilliant support.

Regards,

Then Yoong Ze


On 16/12/2016 2:25 AM, Christopher Collins wrote:
> I should also send a belated heads up to the group.  The "target config"
> command has changed slightly in the latest newt in the develop branch.
> Now, the command is:
>
>      target config show <target-name>
>
> (i.e., "config" became "config show").
>
> The reason for this change is to allow support for additional
> configuration-related commands.  Unfortunately, I didn't have enough
> foresight to make config a command group from the start.
>
> Sorry for the churn, all.
>
> Chris
>
> On Thu, Dec 15, 2016 at 10:13:44AM -0800, Christopher Collins wrote:
>> Hi Then,
>>
>> I didn't see the png files; did you forgot to attach them?  Also, the
>> output.txt file appears to be incomplete.  One easy way to capture newt
>> output is to use the "-o <filename>" option.  For example:
>>
>>      newt -o output.txt target config myble
>>
>> All output gets printed to the terminal, but it also gets written to the
>> specified file.  Then you can just attach output.txt to your next email.
>>
>> Also, just to be clear, it is recommended that you only change your
>> *target*'s syscfg.  If you change other packages, like apps/bletiny, it
>> might result in conflicts the next time you update your
>> apache-mynewt-core repository.
>>
>> So, I would expect you to have the following file:
>>
>>      targets/myble/syscfg.yml
>>
>> This file would look something like this:
>>
>>      syscfg.vals:
>>          STATS_CLI: 1
>>
>> Finally, you should not need to add the "@apache-mynewt-core/sys/stats"
>> dependency to bletiny.  The net/nimble/host package depends on
>> the stats package, so it should already get included in your project.
>>
>> Thanks,
>> Chris
>>
>> On Thu, Dec 15, 2016 at 02:13:55PM +0800, then yon wrote:
>>> Dear dg,
>>>
>>> Thanks for your reply.
>>>
>>> i had followed your step to add syscfg.yml under targets but it doesn't
>>> help.
>>>
>>> Please find the attachment for:
>>>
>>> 1. output.txt: output of the target config command.
>>>
>>> 2. syscfg_yml_app.png: print screen of the code and directory list for the syscfg.yml under app.
>>>
>>> 3. syscfg_yml_target.png: print screen of the code and directory list for the syscfg.yml under targets.
>>>
>>> Please let me know if you need more information.
>>>
>>> Thank you.
>>>
>>>
>>> Regards,
>>> Then Yoong Ze
> .
>


Re: MYNEWT_VAL_STATS_CLI value cannot be change

Posted by Christopher Collins <cc...@apache.org>.
I should also send a belated heads up to the group.  The "target config"
command has changed slightly in the latest newt in the develop branch.
Now, the command is:

    target config show <target-name>

(i.e., "config" became "config show").

The reason for this change is to allow support for additional
configuration-related commands.  Unfortunately, I didn't have enough
foresight to make config a command group from the start.

Sorry for the churn, all.

Chris

On Thu, Dec 15, 2016 at 10:13:44AM -0800, Christopher Collins wrote:
> Hi Then,
> 
> I didn't see the png files; did you forgot to attach them?  Also, the
> output.txt file appears to be incomplete.  One easy way to capture newt
> output is to use the "-o <filename>" option.  For example:
> 
>     newt -o output.txt target config myble
> 
> All output gets printed to the terminal, but it also gets written to the
> specified file.  Then you can just attach output.txt to your next email.
> 
> Also, just to be clear, it is recommended that you only change your
> *target*'s syscfg.  If you change other packages, like apps/bletiny, it
> might result in conflicts the next time you update your
> apache-mynewt-core repository.
> 
> So, I would expect you to have the following file:
> 
>     targets/myble/syscfg.yml
> 
> This file would look something like this:
> 
>     syscfg.vals:
>         STATS_CLI: 1
> 
> Finally, you should not need to add the "@apache-mynewt-core/sys/stats"
> dependency to bletiny.  The net/nimble/host package depends on
> the stats package, so it should already get included in your project.
> 
> Thanks,
> Chris
> 
> On Thu, Dec 15, 2016 at 02:13:55PM +0800, then yon wrote:
> > Dear dg,
> > 
> > Thanks for your reply.
> > 
> > i had followed your step to add syscfg.yml under targets but it doesn't 
> > help.
> > 
> > Please find the attachment for:
> > 
> > 1. output.txt: output of the target config command.
> > 
> > 2. syscfg_yml_app.png: print screen of the code and directory list for the syscfg.yml under app.
> > 
> > 3. syscfg_yml_target.png: print screen of the code and directory list for the syscfg.yml under targets.
> > 
> > Please let me know if you need more information.
> > 
> > Thank you.
> > 
> > 
> > Regards,
> > Then Yoong Ze

Re: MYNEWT_VAL_STATS_CLI value cannot be change

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

I didn't see the png files; did you forgot to attach them?  Also, the
output.txt file appears to be incomplete.  One easy way to capture newt
output is to use the "-o <filename>" option.  For example:

    newt -o output.txt target config myble

All output gets printed to the terminal, but it also gets written to the
specified file.  Then you can just attach output.txt to your next email.

Also, just to be clear, it is recommended that you only change your
*target*'s syscfg.  If you change other packages, like apps/bletiny, it
might result in conflicts the next time you update your
apache-mynewt-core repository.

So, I would expect you to have the following file:

    targets/myble/syscfg.yml

This file would look something like this:

    syscfg.vals:
        STATS_CLI: 1

Finally, you should not need to add the "@apache-mynewt-core/sys/stats"
dependency to bletiny.  The net/nimble/host package depends on
the stats package, so it should already get included in your project.

Thanks,
Chris

On Thu, Dec 15, 2016 at 02:13:55PM +0800, then yon wrote:
> Dear dg,
> 
> Thanks for your reply.
> 
> i had followed your step to add syscfg.yml under targets but it doesn't 
> help.
> 
> Please find the attachment for:
> 
> 1. output.txt: output of the target config command.
> 
> 2. syscfg_yml_app.png: print screen of the code and directory list for the syscfg.yml under app.
> 
> 3. syscfg_yml_target.png: print screen of the code and directory list for the syscfg.yml under targets.
> 
> Please let me know if you need more information.
> 
> Thank you.
> 
> 
> Regards,
> Then Yoong Ze

Re: MYNEWT_VAL_STATS_CLI value cannot be change

Posted by "David G. Simmons" <sa...@mac.com>.
Good morning,

I looked at this a bit more, and tested a few things with one of my apps. I'm wondering what version of apache-mynewt-core you have in your repos/ directory. 

I'll have to update the docs, because with the current version, I did not need to add the 

  /* Initialize the statistics package */
    rc = stats_module_init();
    assert(rc == 0);

to my app. All I had to do was add STATS_CLI: 1 to my syscfg.yml file for the target and the stats package began to work from the command line. You of course have to have the Console and Shell working first. :-) 

In fact, the tutorial on enabling the stats package at http://mynewt.apache.org/latest/os/tutorials/bletiny_project/ <http://mynewt.apache.org/latest/os/tutorials/bletiny_project/> no longer mentions adding the above code. I'll work on updating the BLE Users guide to reflect the changes. It's been hard to keep the docs sync'ed with all the changes lately to the code and how things work now, but we're working on it! 

Best regards,
dg

> On Dec 15, 2016, at 1:13 AM, then yon <yz...@free2move.se> wrote:
> 
> Dear dg,
> 
> Thanks for your reply.
> 
> i had followed your step to add syscfg.yml under targets but it doesn't help.
> 
> Please find the attachment for:
> 
> 1. output.txt: output of the target config command.
> 
> 2. syscfg_yml_app.png: print screen of the code and directory list for the syscfg.yml under app.
> 
> 3. syscfg_yml_target.png: print screen of the code and directory list for the syscfg.yml under targets.
> 
> Please let me know if you need more information.
> 
> Thank you.

--
David G. Simmons
(919) 534-5099
Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
/** Message digitally signed for security and authenticity.  
* If you cannot read the PGP.sig attachment, please go to 
 * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
 * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
**/
♺ This email uses 100% recycled electrons. Don't blow it by printing!

There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.



Re: MYNEWT_VAL_STATS_CLI value cannot be change

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

Thanks for your reply.

i had followed your step to add syscfg.yml under targets but it doesn't 
help.

Please find the attachment for:

1. output.txt: output of the target config command.

2. syscfg_yml_app.png: print screen of the code and directory list for the syscfg.yml under app.

3. syscfg_yml_target.png: print screen of the code and directory list for the syscfg.yml under targets.

Please let me know if you need more information.

Thank you.


Regards,
Then Yoong Ze


On 14/12/2016 10:40 PM, David G. Simmons wrote:
> Sorry to hear you're having trouble. I'll see if I can help out a bit.
>
> First, rather than making changes to the syscfg.yml file in bletiny app itself, if you look in the targets directory of your project, you'll see that each app has it's own directory, and in that directory you'll find an app-specific syscfg.yml file. If that file doesn't exist, you can create it.
>
> $ cat targets/myble//syscfg.yml
> # Package: apps/bletiny
>
> syscfg.vals:
>      # Enable the shell task.
>      SHELL_TASK: 1
>
>      CONSOLE_TICKS: 1
>      CONSOLE_PROMPT: 1
>
> It's much easier to keep track of changes you've made to your configuration if you make those changes per-app rather than at the repository level as they won't get wiped out if/when you update your repos.
>
> That being said, for your app, you can run
>
> $ newt target config bletiny
> newt target config myble | more
> 2016/12/14 09:37:00 [WARNING] Ignoring override of undefined settings:
> 2016/12/14 09:37:00 [WARNING]     CONFIG_FCB_FLASH_AREA
> 2016/12/14 09:37:00 [WARNING]     COREDUMP_FLASH_AREA
> 2016/12/14 09:37:00 [WARNING]     NFFS_FLASH_AREA
> 2016/12/14 09:37:00 [WARNING]     REBOOT_LOG_FLASH_AREA
> 2016/12/14 09:37:00 [WARNING] Setting history (newest -> oldest):
> 2016/12/14 09:37:00 [WARNING]     CONFIG_FCB_FLASH_AREA: [hw/bsp/nrf52dk:FLASH_AREA_NFFS]
> 2016/12/14 09:37:00 [WARNING]     COREDUMP_FLASH_AREA: [hw/bsp/nrf52dk:FLASH_AREA_IMAGE_1]
> 2016/12/14 09:37:00 [WARNING]     NFFS_FLASH_AREA: [hw/bsp/nrf52dk:FLASH_AREA_NFFS]
> 2016/12/14 09:37:00 [WARNING]     REBOOT_LOG_FLASH_AREA: [hw/bsp/nrf52dk:FLASH_AREA_REBOOT_LOG]
> Syscfg for targets/myble:
> * PACKAGE: boot/bootutil
>    * Setting: BOOTUTIL_SIGN_EC
>      * Description: TBD
>      * Value: 0
>    * Setting: BOOTUTIL_SIGN_RSA
>      * Description: TBD
>      * Value: 0
> ...
>
> You'll see the complete configuration of your app. Most notably, at the top, you'll see any config values that are ignored, over-ridden, or incorrect.
>
> Could you send the output of the target config command so we can see if there are any conflicting configuration settings?
>
> Thanks,
> dg
>
>> On Dec 14, 2016, at 5:01 AM, then yon <yz...@free2move.se> wrote:
>>
>> Dear Support,
>>
>> I been using MyNewt v1.0.0-dev, and i tried to enable statistic package for bletiny project so i can use the stat command.
>>
>> What i did was following the tutorial below:
>>
>> http://mynewt.apache.org/network/ble/ini_stack/ble_statpkg/
>>
>> and i try to change MYNEWT_VAL_STATS_CLI to 1 by adding STATS_CLI: 1 to bletiny/syscfg.yml and -"@apache-mynewt-core/sys/stats" to bletiny/pkg.yml.
>>
>> But after i build it doesn't change the MYNEWT_VAL_STATS_CLI at target/generated/include/syscfg/syscfg.h.
>>
>> Please help if i missing some important step on this.
>>
>> ps: stat command is working if i comment out #if MYNEWT_VAL(STATS_CLI)
>>
>> Thank you.
>>
>> Regards,
>>
>> Then Yoong Ze
>>
> --
> David G. Simmons
> (919) 534-5099
> Web <https://davidgs.com/> \u2022 Blog <https://davidgs.com/davidgs_blog> \u2022 Linkedin <http://linkedin.com/in/davidgsimmons> \u2022 Twitter <http://twitter.com/TechEvangelist1> \u2022 GitHub <http://github.com/davidgs>
> /** Message digitally signed for security and authenticity.
> * If you cannot read the PGP.sig attachment, please go to
>   * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
>   * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
> **/
> \u267a This email uses 100% recycled electrons. Don't blow it by printing!
>
> There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.
>
>
>


Re: MYNEWT_VAL_STATS_CLI value cannot be change

Posted by "David G. Simmons" <sa...@mac.com>.
Sorry to hear you're having trouble. I'll see if I can help out a bit. 

First, rather than making changes to the syscfg.yml file in bletiny app itself, if you look in the targets directory of your project, you'll see that each app has it's own directory, and in that directory you'll find an app-specific syscfg.yml file. If that file doesn't exist, you can create it. 

$ cat targets/myble//syscfg.yml
# Package: apps/bletiny

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

    CONSOLE_TICKS: 1
    CONSOLE_PROMPT: 1

It's much easier to keep track of changes you've made to your configuration if you make those changes per-app rather than at the repository level as they won't get wiped out if/when you update your repos.

That being said, for your app, you can run 

$ newt target config bletiny
newt target config myble | more
2016/12/14 09:37:00 [WARNING] Ignoring override of undefined settings:
2016/12/14 09:37:00 [WARNING]     CONFIG_FCB_FLASH_AREA
2016/12/14 09:37:00 [WARNING]     COREDUMP_FLASH_AREA
2016/12/14 09:37:00 [WARNING]     NFFS_FLASH_AREA
2016/12/14 09:37:00 [WARNING]     REBOOT_LOG_FLASH_AREA
2016/12/14 09:37:00 [WARNING] Setting history (newest -> oldest):
2016/12/14 09:37:00 [WARNING]     CONFIG_FCB_FLASH_AREA: [hw/bsp/nrf52dk:FLASH_AREA_NFFS]
2016/12/14 09:37:00 [WARNING]     COREDUMP_FLASH_AREA: [hw/bsp/nrf52dk:FLASH_AREA_IMAGE_1]
2016/12/14 09:37:00 [WARNING]     NFFS_FLASH_AREA: [hw/bsp/nrf52dk:FLASH_AREA_NFFS]
2016/12/14 09:37:00 [WARNING]     REBOOT_LOG_FLASH_AREA: [hw/bsp/nrf52dk:FLASH_AREA_REBOOT_LOG]
Syscfg for targets/myble:
* PACKAGE: boot/bootutil
  * Setting: BOOTUTIL_SIGN_EC
    * Description: TBD
    * Value: 0
  * Setting: BOOTUTIL_SIGN_RSA
    * Description: TBD
    * Value: 0
...

You'll see the complete configuration of your app. Most notably, at the top, you'll see any config values that are ignored, over-ridden, or incorrect.

Could you send the output of the target config command so we can see if there are any conflicting configuration settings?

Thanks,
dg

> On Dec 14, 2016, at 5:01 AM, then yon <yz...@free2move.se> wrote:
> 
> Dear Support,
> 
> I been using MyNewt v1.0.0-dev, and i tried to enable statistic package for bletiny project so i can use the stat command.
> 
> What i did was following the tutorial below:
> 
> http://mynewt.apache.org/network/ble/ini_stack/ble_statpkg/
> 
> and i try to change MYNEWT_VAL_STATS_CLI to 1 by adding STATS_CLI: 1 to bletiny/syscfg.yml and -"@apache-mynewt-core/sys/stats" to bletiny/pkg.yml.
> 
> But after i build it doesn't change the MYNEWT_VAL_STATS_CLI at target/generated/include/syscfg/syscfg.h.
> 
> Please help if i missing some important step on this.
> 
> ps: stat command is working if i comment out #if MYNEWT_VAL(STATS_CLI)
> 
> Thank you.
> 
> Regards,
> 
> Then Yoong Ze
> 

--
David G. Simmons
(919) 534-5099
Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin <http://linkedin.com/in/davidgsimmons> • Twitter <http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
/** Message digitally signed for security and authenticity.  
* If you cannot read the PGP.sig attachment, please go to 
 * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
 * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
**/
♺ This email uses 100% recycled electrons. Don't blow it by printing!

There are only 2 hard things in computer science: Cache invalidation, naming things, and off-by-one errors.