How to write a string to serial?


kk <pinganddu90@...>
 

Thanks all, I have solve the problem by using:
    for(;;)
    {
        printk("Hello World\n");
    }
But those were all garbled on the minicom. How about yours? How yours see the debug information from serial generally?

On Thu, Mar 30, 2017 at 8:21 AM, Qiu, PeiyangX <peiyangx.qiu@...> wrote:

You can try changing the serial connections.

Green -> RX

White -> TX

Black -> GND

 

From: zephyr-users-bounces@lists.zephyrproject.org [mailto:zephyr-users-bounces@lists.zephyrproject.org] On Behalf Of kk
Sent: Wednesday, March 29, 2017 10:57 PM
To: zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-users] How to write a string to serial?

 

Hi all

I am new to this mailing list.

I connect my arduino 101 to minicom, I have set the serial port:
    ttyUSB0 8N1

I use the Adafruit 4 pin cable (PL2303)

    black Ground connect GND on arduino 101

    green Receive connect TX->1 on arduino 101

    white Transmit connect  RX->1 on arduino 101

I run the hello_world program:

    make BOARD=arduino_101 flash

everything go well, but I can't see the "Hello World! x86" on the minicom.
I use the BOARD=qemu_x86, I can see the string "Hello World! x86"

So my question is how to write a string to serial?

Thanks!

 

 

 



Qiu, PeiyangX <peiyangx.qiu@...>
 

You can try changing the serial connections.

Green -> RX

White -> TX

Black -> GND

 

From: zephyr-users-bounces@... [mailto:zephyr-users-bounces@...] On Behalf Of kk
Sent: Wednesday, March 29, 2017 10:57 PM
To: zephyr-users@...
Subject: [Zephyr-users] How to write a string to serial?

 

Hi all

I am new to this mailing list.

I connect my arduino 101 to minicom, I have set the serial port:
    ttyUSB0 8N1

I use the Adafruit 4 pin cable (PL2303)

    black Ground connect GND on arduino 101

    green Receive connect TX->1 on arduino 101

    white Transmit connect  RX->1 on arduino 101

I run the hello_world program:

    make BOARD=arduino_101 flash

everything go well, but I can't see the "Hello World! x86" on the minicom.
I use the BOARD=qemu_x86, I can see the string "Hello World! x86"

So my question is how to write a string to serial?

Thanks!

 

 

 


kk <pinganddu90@...>
 

My def_config was arduino_101_defconfig.

On Wed, Mar 29, 2017 at 11:55 PM, kk <pinganddu90@...> wrote:
Hi Feilpe

I found the "task_sleep()" function in legacy.h, When I add the "task_sleep(500)" and the include file legacy.h, the compiler tell:
    undefined reference to `_legacy_sleep'
I am confused.

Thanks
   

On Wed, Mar 29, 2017 at 11:34 PM, Felipe Neves <ryukokki.felipe@...> wrote:

Hi, depending on where the message is placed, you will not see it on console.

if I remember the hw example in zephyr was implemented on whis way:

void main(void)
{
   printf("Hello_x86! \r");
}

Instead, do a slight modification on main.c on main function to become:


void main(void)
{
   for(;;) { 
          printf("Hello_x86! \r");
          task_sleep(500);
   }
}


This will continuosly prints the message on your console, and if your def_config is okay, you will able to see the messages hitting
on your minicom instance.

Best,

Felipe

2017-03-29 12:06 GMT-03:00 Kumar Gala <kumar.gala@...>:

> On Mar 29, 2017, at 9:56 AM, kk <pinganddu90@...> wrote:
>
> Hi all
>
> I am new to this mailing list.
> I connect my arduino 101 to minicom, I have set the serial port:
>     ttyUSB0 8N1
> I use the Adafruit 4 pin cable (PL2303)
>     black Ground connect GND on arduino 101
>     green Receive connect TX->1 on arduino 101
>     white Transmit connect  RX->1 on arduino 101
> I run the hello_world program:
>     make BOARD=arduino_101 flash
> everything go well, but I can't see the "Hello World! x86" on the minicom.
> I use the BOARD=qemu_x86, I can see the string "Hello World! x86"
> So my question is how to write a string to serial?
>
> Thanks!
>
>
>
> _______________________________________________
> Zephyr-users mailing list
> Zephyr-users@...ct.org
> https://lists.zephyrproject.org/mailman/listinfo/zephyr-users

If you just use printf() you will get strings outputted to serial with most default configurations.

- k
_______________________________________________
Zephyr-users mailing list
Zephyr-users@...ct.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users



--
Felipe S. Neves 
Embedded software & systems engineer
Skype: fneves1989
+55 11 96610 – 0855 



kk <pinganddu90@...>
 

Hi Feilpe

I found the "task_sleep()" function in legacy.h, When I add the "task_sleep(500)" and the include file legacy.h, the compiler tell:
    undefined reference to `_legacy_sleep'
I am confused.

Thanks
   

On Wed, Mar 29, 2017 at 11:34 PM, Felipe Neves <ryukokki.felipe@...> wrote:

Hi, depending on where the message is placed, you will not see it on console.

if I remember the hw example in zephyr was implemented on whis way:

void main(void)
{
   printf("Hello_x86! \r");
}

Instead, do a slight modification on main.c on main function to become:


void main(void)
{
   for(;;) { 
          printf("Hello_x86! \r");
          task_sleep(500);
   }
}


This will continuosly prints the message on your console, and if your def_config is okay, you will able to see the messages hitting
on your minicom instance.

Best,

Felipe

2017-03-29 12:06 GMT-03:00 Kumar Gala <kumar.gala@...>:

> On Mar 29, 2017, at 9:56 AM, kk <pinganddu90@...> wrote:
>
> Hi all
>
> I am new to this mailing list.
> I connect my arduino 101 to minicom, I have set the serial port:
>     ttyUSB0 8N1
> I use the Adafruit 4 pin cable (PL2303)
>     black Ground connect GND on arduino 101
>     green Receive connect TX->1 on arduino 101
>     white Transmit connect  RX->1 on arduino 101
> I run the hello_world program:
>     make BOARD=arduino_101 flash
> everything go well, but I can't see the "Hello World! x86" on the minicom.
> I use the BOARD=qemu_x86, I can see the string "Hello World! x86"
> So my question is how to write a string to serial?
>
> Thanks!
>
>
>
> _______________________________________________
> Zephyr-users mailing list
> Zephyr-users@...ct.org
> https://lists.zephyrproject.org/mailman/listinfo/zephyr-users

If you just use printf() you will get strings outputted to serial with most default configurations.

- k
_______________________________________________
Zephyr-users mailing list
Zephyr-users@...ct.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users



--
Felipe S. Neves 
Embedded software & systems engineer
Skype: fneves1989
+55 11 96610 – 0855 


Felipe Neves
 


Hi, depending on where the message is placed, you will not see it on console.

if I remember the hw example in zephyr was implemented on whis way:

void main(void)
{
   printf("Hello_x86! \r");
}

Instead, do a slight modification on main.c on main function to become:


void main(void)
{
   for(;;) { 
          printf("Hello_x86! \r");
          task_sleep(500);
   }
}


This will continuosly prints the message on your console, and if your def_config is okay, you will able to see the messages hitting
on your minicom instance.

Best,

Felipe

2017-03-29 12:06 GMT-03:00 Kumar Gala <kumar.gala@...>:


> On Mar 29, 2017, at 9:56 AM, kk <pinganddu90@...> wrote:
>
> Hi all
>
> I am new to this mailing list.
> I connect my arduino 101 to minicom, I have set the serial port:
>     ttyUSB0 8N1
> I use the Adafruit 4 pin cable (PL2303)
>     black Ground connect GND on arduino 101
>     green Receive connect TX->1 on arduino 101
>     white Transmit connect  RX->1 on arduino 101
> I run the hello_world program:
>     make BOARD=arduino_101 flash
> everything go well, but I can't see the "Hello World! x86" on the minicom.
> I use the BOARD=qemu_x86, I can see the string "Hello World! x86"
> So my question is how to write a string to serial?
>
> Thanks!
>
>
>
> _______________________________________________
> Zephyr-users mailing list
> Zephyr-users@lists.zephyrproject.org
> https://lists.zephyrproject.org/mailman/listinfo/zephyr-users

If you just use printf() you will get strings outputted to serial with most default configurations.

- k
_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users



--
Felipe S. Neves 
Embedded software & systems engineer
Skype: fneves1989
+55 11 96610 – 0855 


kk <pinganddu90@...>
 

Hi Kumar

That not works

Thanks

On Wed, Mar 29, 2017 at 11:06 PM, Kumar Gala <kumar.gala@...> wrote:

> On Mar 29, 2017, at 9:56 AM, kk <pinganddu90@...> wrote:
>
> Hi all
>
> I am new to this mailing list.
> I connect my arduino 101 to minicom, I have set the serial port:
>     ttyUSB0 8N1
> I use the Adafruit 4 pin cable (PL2303)
>     black Ground connect GND on arduino 101
>     green Receive connect TX->1 on arduino 101
>     white Transmit connect  RX->1 on arduino 101
> I run the hello_world program:
>     make BOARD=arduino_101 flash
> everything go well, but I can't see the "Hello World! x86" on the minicom.
> I use the BOARD=qemu_x86, I can see the string "Hello World! x86"
> So my question is how to write a string to serial?
>
> Thanks!
>
>
>
> _______________________________________________
> Zephyr-users mailing list
> Zephyr-users@lists.zephyrproject.org
> https://lists.zephyrproject.org/mailman/listinfo/zephyr-users

If you just use printf() you will get strings outputted to serial with most default configurations.

- k


Kumar Gala
 

On Mar 29, 2017, at 9:56 AM, kk <pinganddu90@gmail.com> wrote:

Hi all

I am new to this mailing list.
I connect my arduino 101 to minicom, I have set the serial port:
ttyUSB0 8N1
I use the Adafruit 4 pin cable (PL2303)
black Ground connect GND on arduino 101
green Receive connect TX->1 on arduino 101
white Transmit connect RX->1 on arduino 101
I run the hello_world program:
make BOARD=arduino_101 flash
everything go well, but I can't see the "Hello World! x86" on the minicom.
I use the BOARD=qemu_x86, I can see the string "Hello World! x86"
So my question is how to write a string to serial?

Thanks!



_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users
If you just use printf() you will get strings outputted to serial with most default configurations.

- k


kk <pinganddu90@...>
 

Hi all

I am new to this mailing list.
I connect my arduino 101 to minicom, I have set the serial port:
    ttyUSB0 8N1
I use the Adafruit 4 pin cable (PL2303)
    black Ground connect GND on arduino 101
    green Receive connect TX->1 on arduino 101
    white Transmit connect  RX->1 on arduino 101
I run the hello_world program:
    make BOARD=arduino_101 flash
everything go well, but I can't see the "Hello World! x86" on the minicom.
I use the BOARD=qemu_x86, I can see the string "Hello World! x86"
So my question is how to write a string to serial?

Thanks!