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/19 08:50:41 UTC

Problem Enabling The Console and Shell in blinky project

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: 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.