Date   

Debugging Zephyr using no able to stop at specific source line after init.c #debugging

ngbk1993@...
 
Edited


Hi All,

I'm trying to enable Zephyr with a SoC(4-cores CPU) that not listed in the Zephyr page.

Currently I'm able to step the code using the ARM Development studio and able to step (single step)
until the source line at zephyrproject/zephyr/kernel/init.c:233  (printk(*** Botting Zephyr OS Build .......))

The zephyr will always jump to system halt when i'm trying to
1) Set a break point after the line 233 
2) Stepping source line 

When I try to single step, it can go very far beyond line of init.c:233.

Then I try to edit the init.c and place a forever while loop before line:233, hopefully the program will help me to stop at line 233 without me to do a single step for debug, but still no luck, zephyr will still jump into system halt.

Want to ask Is there any watchdog timer implemented on zephyr that check if zephyr hang?

Regards,
ngbk

PS: Sorry for the incomplete title, Debugging Zephyr using ARMDS and not able to stop at specific source line after init.c


Re: Nucleo STM32F411RE PWM support

Florian Hester
 

Hello,

I've added the pin PA8 to PWM of timers1:

timers1: timers@40010000 {
            status = "okay";

            pwm {
                status = "okay";
                pinctrl-0 = <&tim1_ch1_pwm_pa8>;
            };
 };

This did not work (no output pulse, no error logged either).

However, the PA5 pin (configured like above for PWM of timers2) did work, and now i have a nice 100 microsecond period pulse on that pin.

I've tried the second channel (tim1_ch2_pwm_pa9) of the first timer, but that one (like the first channel) also does not work (no output pulse).

Im going try more of the PWM channels, to see what is working and what is not, but it seems like the first pwm device (PWM_1, as part of timers1) is not working, any reason why not?

Florian

Op 12/11/2020 om 17:03 schreef Erwan Gouriou:

Hi Florian,

You also need to configure a pin, something like:
&timers2 {
           status = "okay";

           pwm2: pwm {
           status = "okay";
+           pinctrl-0 = <&tim2_ch1_pwm_pa5>;
           };
};

Please let us know if this was helpful.

Erwan

On Thu, 12 Nov 2020 at 13:58, Florian Hester via lists.zephyrproject.org <http://lists.zephyrproject.org> <florian=celaeno.org@lists.zephyrproject.org <mailto:celaeno.org@lists.zephyrproject.org>> wrote:

Hello,

I have used the following overlay:

/ {
     soc {
         timers1: timers@40010000 {
             status = "okay";

             pwm {
                 status = "okay";
             };
         };

         timers2: timers@40000000 {
             status = "okay";

             pwm {
                 status = "okay";
             };
         };

         timers3: timers@40000400 {
             status = "okay";

             pwm {
                 status = "okay";
             };
         };

         timers4: timers@40000800 {
             status = "okay";

             pwm {
                 status = "okay";
             };
         };
     };
};

The prj.conf file contains the following regarding PWM:

CONFIG_PWM=y
CONFIG_PWM_STM32=y

I used the following code to test:

     auto dev_pwm = device_get_binding("PWM_1");

     if (dev_pwm != nullptr)
     {
         LOG_INF("Have PWM device.");

         int ret = pwm_pin_set_usec(dev_pwm, 1, 100, 50, 0);

         if (ret != 0)
         {
             LOG_ERR("Could not set PWM.");
         }
         else
         {
             LOG_INF("PWM set.");
         }
     }

The output:

[00:00:00.006,000] <inf> main: Have PWM device.
[00:00:00.006,000] <inf> main: PWM set.

I am measuring pin D7 on the board (PA8 for the chip), and no pulse.

Florian

Op 12/11/2020 om 08:36 schreef Adam Podogrocki:
> Hi Florian,
>
> have you set /status/ of the appropriate Timer & PWM device to
"okay"?
> Have you activated the PWM driver in Zephyr Menu Config? Have you
> successfully got device binding in the source code?
>
> Cheers,
> Adam
>
> On Thu, 12 Nov 2020 at 01:54, Florian Hester via
> lists.zephyrproject.org <http://lists.zephyrproject.org>
<http://lists.zephyrproject.org <http://lists.zephyrproject.org>>
> <florian=celaeno.org@lists.zephyrproject.org
<mailto:celaeno.org@lists.zephyrproject.org>
> <mailto:celaeno.org@lists.zephyrproject.org
<mailto:celaeno.org@lists.zephyrproject.org>>> wrote:
>
>     Hello,
>
>     When i look at the documentation of the Nucleo F411RE board at:
>
>
https://docs.zephyrproject.org/latest/boards/arm/nucleo_f411re/doc/index.html
<https://docs.zephyrproject.org/latest/boards/arm/nucleo_f411re/doc/index.html>
>   
 <https://docs.zephyrproject.org/latest/boards/arm/nucleo_f411re/doc/index.html
<https://docs.zephyrproject.org/latest/boards/arm/nucleo_f411re/doc/index.html>>
>
>     I can see PWM as a supported feature. However,  the board
YAML file
>     (boards/arm/nucleo_f411re.yml) does not list PWM as
supported and the
>     board DTS (boards/arm/nucleo_f411re/nucleo_f411re.dts) does not
>     enable
>     any PWM device present on the hardware.
>
>     I've tried using an overlay to enable it anyway (the timers
and the
>     pwms), this compiles successfully and flashes (via JLink)
>     successfully,
>     but using the PWM API (or the shell pwm commands) does not
appear to
>     have any effect (no output pulse).
>
>     I have tried the PWM functionality in ARM mbed, where it works.
>
>     Why does Zephyr not have support for PWM on this board?
>
>
>     Florian
>
>
>
>
>
>
>
>




Add custom code

sarvg@...
 

Dear community,
ist it possible to add my own file.c , file.h code to my zephyr project? If yes, how can i do that? Any examples or tutorial?
 
Thanks in advance
 
sarvg


Re: Nucleo STM32F411RE PWM support

Erwan Gouriou
 

Hi Florian, 

You also need to configure a pin, something like:
&timers2 {
           status = "okay";

           pwm2: pwm {
           status = "okay";
+           pinctrl-0 = <&tim2_ch1_pwm_pa5>;
           };
};

Please let us know if this was helpful.

Erwan

On Thu, 12 Nov 2020 at 13:58, Florian Hester via lists.zephyrproject.org <florian=celaeno.org@...> wrote:
Hello,

I have used the following overlay:

/ {
     soc {
         timers1: timers@40010000 {
             status = "okay";

             pwm {
                 status = "okay";
             };
         };

         timers2: timers@40000000 {
             status = "okay";

             pwm {
                 status = "okay";
             };
         };

         timers3: timers@40000400 {
             status = "okay";

             pwm {
                 status = "okay";
             };
         };

         timers4: timers@40000800 {
             status = "okay";

             pwm {
                 status = "okay";
             };
         };
     };
};

The prj.conf file contains the following regarding PWM:

CONFIG_PWM=y
CONFIG_PWM_STM32=y

I used the following code to test:

     auto dev_pwm = device_get_binding("PWM_1");

     if (dev_pwm != nullptr)
     {
         LOG_INF("Have PWM device.");

         int ret = pwm_pin_set_usec(dev_pwm, 1, 100, 50, 0);

         if (ret != 0)
         {
             LOG_ERR("Could not set PWM.");
         }
         else
         {
             LOG_INF("PWM set.");
         }
     }

The output:

[00:00:00.006,000] <inf> main: Have PWM device.
[00:00:00.006,000] <inf> main: PWM set.

I am measuring pin D7 on the board (PA8 for the chip), and no pulse.

Florian

Op 12/11/2020 om 08:36 schreef Adam Podogrocki:
> Hi Florian,
>
> have you set /status/ of the appropriate Timer & PWM device to "okay"?
> Have you activated the PWM driver in Zephyr Menu Config? Have you
> successfully got device binding in the source code?
>
> Cheers,
> Adam
>
> On Thu, 12 Nov 2020 at 01:54, Florian Hester via
> lists.zephyrproject.org <http://lists.zephyrproject.org>
> <florian=celaeno.org@...
> <mailto:celaeno.org@...>> wrote:
>
>     Hello,
>
>     When i look at the documentation of the Nucleo F411RE board at:
>
>     https://docs.zephyrproject.org/latest/boards/arm/nucleo_f411re/doc/index.html
>     <https://docs.zephyrproject.org/latest/boards/arm/nucleo_f411re/doc/index.html>
>
>     I can see PWM as a supported feature. However,  the board YAML file
>     (boards/arm/nucleo_f411re.yml) does not list PWM as supported and the
>     board DTS (boards/arm/nucleo_f411re/nucleo_f411re.dts) does not
>     enable
>     any PWM device present on the hardware.
>
>     I've tried using an overlay to enable it anyway (the timers and the
>     pwms), this compiles successfully and flashes (via JLink)
>     successfully,
>     but using the PWM API (or the shell pwm commands) does not appear to
>     have any effect (no output pulse).
>
>     I have tried the PWM functionality in ARM mbed, where it works.
>
>     Why does Zephyr not have support for PWM on this board?
>
>
>     Florian
>
>
>
>
>
>     
>
>






Re: Nucleo STM32F411RE PWM support

Florian Hester
 

Hello,

I have used the following overlay:

/ {
    soc {
        timers1: timers@40010000 {
            status = "okay";

            pwm {
                status = "okay";
            };
        };

        timers2: timers@40000000 {
            status = "okay";

            pwm {
                status = "okay";
            };
        };

        timers3: timers@40000400 {
            status = "okay";

            pwm {
                status = "okay";
            };
        };

        timers4: timers@40000800 {
            status = "okay";

            pwm {
                status = "okay";
            };
        };
    };
};

The prj.conf file contains the following regarding PWM:

CONFIG_PWM=y
CONFIG_PWM_STM32=y

I used the following code to test:

    auto dev_pwm = device_get_binding("PWM_1");

    if (dev_pwm != nullptr)
    {
        LOG_INF("Have PWM device.");

        int ret = pwm_pin_set_usec(dev_pwm, 1, 100, 50, 0);

        if (ret != 0)
        {
            LOG_ERR("Could not set PWM.");
        }
        else
        {
            LOG_INF("PWM set.");
        }
    }

The output:

[00:00:00.006,000] <inf> main: Have PWM device.
[00:00:00.006,000] <inf> main: PWM set.

I am measuring pin D7 on the board (PA8 for the chip), and no pulse.

Florian

Op 12/11/2020 om 08:36 schreef Adam Podogrocki:

Hi Florian,

have you set /status/ of the appropriate Timer & PWM device to "okay"? Have you activated the PWM driver in Zephyr Menu Config? Have you successfully got device binding in the source code?

Cheers,
Adam

On Thu, 12 Nov 2020 at 01:54, Florian Hester via lists.zephyrproject.org <http://lists.zephyrproject.org> <florian=celaeno.org@lists.zephyrproject.org <mailto:celaeno.org@lists.zephyrproject.org>> wrote:

Hello,

When i look at the documentation of the Nucleo F411RE board at:

https://docs.zephyrproject.org/latest/boards/arm/nucleo_f411re/doc/index.html
<https://docs.zephyrproject.org/latest/boards/arm/nucleo_f411re/doc/index.html>

I can see PWM as a supported feature. However,  the board YAML file
(boards/arm/nucleo_f411re.yml) does not list PWM as supported and the
board DTS (boards/arm/nucleo_f411re/nucleo_f411re.dts) does not
enable
any PWM device present on the hardware.

I've tried using an overlay to enable it anyway (the timers and the
pwms), this compiles successfully and flashes (via JLink)
successfully,
but using the PWM API (or the shell pwm commands) does not appear to
have any effect (no output pulse).

I have tried the PWM functionality in ARM mbed, where it works.

Why does Zephyr not have support for PWM on this board?


Florian







Re: Nucleo STM32F411RE PWM support

Adam Podogrocki
 

Hi Florian,

have you set status of the appropriate Timer & PWM device to "okay"? Have you activated the PWM driver in Zephyr Menu Config? Have you successfully got device binding in the source code? 

Cheers,
Adam


On Thu, 12 Nov 2020 at 01:54, Florian Hester via lists.zephyrproject.org <florian=celaeno.org@...> wrote:
Hello,

When i look at the documentation of the Nucleo F411RE board at:

https://docs.zephyrproject.org/latest/boards/arm/nucleo_f411re/doc/index.html

I can see PWM as a supported feature. However,  the board YAML file
(boards/arm/nucleo_f411re.yml) does not list PWM as supported and the
board DTS (boards/arm/nucleo_f411re/nucleo_f411re.dts) does not enable
any PWM device present on the hardware.

I've tried using an overlay to enable it anyway (the timers and the
pwms), this compiles successfully and flashes (via JLink) successfully,
but using the PWM API (or the shell pwm commands) does not appear to
have any effect (no output pulse).

I have tried the PWM functionality in ARM mbed, where it works.

Why does Zephyr not have support for PWM on this board?


Florian









Nucleo STM32F411RE PWM support

Florian Hester
 

Hello,

When i look at the documentation of the Nucleo F411RE board at:

https://docs.zephyrproject.org/latest/boards/arm/nucleo_f411re/doc/index.html

I can see PWM as a supported feature. However,  the board YAML file (boards/arm/nucleo_f411re.yml) does not list PWM as supported and the board DTS (boards/arm/nucleo_f411re/nucleo_f411re.dts) does not enable any PWM device present on the hardware.

I've tried using an overlay to enable it anyway (the timers and the pwms), this compiles successfully and flashes (via JLink) successfully, but using the PWM API (or the shell pwm commands) does not appear to have any effect (no output pulse).

I have tried the PWM functionality in ARM mbed, where it works.

Why does Zephyr not have support for PWM on this board?


Florian


Adding linker options

Rob Meades
 

I would like to add a linker option (-Xlinker --wrap=blah) to my Zephyr build, without editing the main Zephyr files, just append some to the usual linker options for my specific build.

How would I go about doing that?

Rob


API meeting: agenda

Carles Cufi
 


Re: Using an external DTS binding for an out-of-tree driver

Diogo Correia
 

Thanks for both the replies. I was looking initially in the "Devicetree HOWTOs", would never remember to look in custom board related documentation. I had already tried to reply Kumar, by using groups.io web interface, but I guess it didn't work. After Kumar's reply I solved the issue by creating a dts directory to the project's root and adding it to CMakeLists.txt with:

list(APPEND DTS_ROOT
${CMAKE_CURRENT_SOURCE_DIR}/dts
)

Now, after Henrik's reply, I know it was unnecessary to add the directory to CMake. So thanks again to both of you.

Kind regards,
Diogo Correia


Re: Using an external DTS binding for an out-of-tree driver

Henrik Brix Andersen
 

Hi Diogo,

Please have a look at the documentation for creating custom devicetree definitions:
https://docs.zephyrproject.org/latest/application/index.html#devicetree-definitions

You can put the ‘dts’ folder in the application folder and it will automatically be picked up. A few examples in-tree of this:
- https://github.com/zephyrproject-rtos/zephyr/tree/master/samples/drivers/espi/dts
- https://github.com/zephyrproject-rtos/zephyr/tree/master/tests/drivers/gpio/gpio_basic_api/dts
- https://github.com/zephyrproject-rtos/zephyr/tree/master/tests/drivers/regulator/fixed/dts

You can also do board-specific bindings:
- https://github.com/zephyrproject-rtos/zephyr/tree/master/boards/arm/arty/dts

Regards,
Brix
--
Henrik Brix Andersen

On 9 Nov 2020, at 17.18, diogo.correia@fraunhofer.pt wrote:

[Edited Message Follows]

Hi!

I'm developing an out-of-tree driver for Zephyr, that I would like to configure using the board overlay file (just like a normal driver in Zephyr). Is there a way to add an external DTS binding file into the project? Or do I need to modify the zephyr's source code (by adding the .yaml into /dts/bindings)?

Kind regards,
Diogo Correia


Re: Using an external DTS binding for an out-of-tree driver

Kumar Gala
 

On Nov 9, 2020, at 10:18 AM, diogo.correia@fraunhofer.pt wrote:

[Edited Message Follows]

Hi!

I'm developing an out-of-tree driver for Zephyr, that I would like to configure using the board overlay file (just like a normal driver in Zephyr). Is there a way to add an external DTS binding file into the project? Or do I need to modify the zephyr's source code (by adding the .yaml into /dts/bindings)?

Kind regards,
Diogo Correia
Have you looked at:

https://docs.zephyrproject.org/latest/application/index.html#custom-board-devicetree-and-soc-definitions
https://docs.zephyrproject.org/latest/application/index.html#devicetree-definitions

- k


Using an external DTS binding for an out-of-tree driver

Diogo Correia
 
Edited

Hi!
 
I'm developing an out-of-tree driver for Zephyr, that I would like to configure using the board overlay file (just like a normal driver in Zephyr). Is there a way to add an external DTS binding file into the project? Or do I need to modify the zephyr's source code (by adding the .yaml into /dts/bindings)?
 
Kind regards,
Diogo Correia
 


How to read and write GPIO pins on nRF5340 #gpio

mohamed.belaroussi@...
 

Hello,

Can someone please tell how to read/write to GPIO pins (ports P0 and P1)?
I am using zephyr and NRF Connect v1.30

Thank you.

Kind regards

Mohamed Belaroussi


CPU frequency and RISC-V boards

Peter Kietzmann
 

Dear community,

how is the CPU frequency configured in zephyr? I found `clock-frequency`
configurations for `cpu0` in different device tree source files. This is
missing for hifive1_revb or rv32m1_vega_zero_riscy, however,
hifive1_revb defines `clock-frequency = <16000000>` (16 MHz) in multiple
peripheral structures. Is this the CPU frequency? The platform is
supposed to run with up to 320 MHz, though.

More specifically, I would like to run both platforms with maximum
speed. How can I achieve that? I'd be happy about any advice :).

Cheers
Peter


Re: Cortex support for OpenISA VEGAboard?

Peter Kietzmann
 

Thanks for the fast response, Henrik!

Best
Peter


Am 04.11.20 um 23:51 schrieb Henrik Brix Andersen:

Hi Peter,

Until recently there was an open draft PR adding support for the CM4 core within the RV32M1:
https://github.com/zephyrproject-rtos/zephyr/pull/27497

Unfortunately it was closed due to inactivity.

Regards,
Brix
--
Henrik Brix Andersen

On 4 Nov 2020, at 12.15, Peter Kietzmann <peter.kietzmann@haw-hamburg.de> wrote:

Dear community,

is there support for operating the OpenISA VEGAboard with the Cortex M4F
or Cortex M0+ processors? If yes, can someone point me to the
development procedure? If no, is anyone working on that?

Cheers
Peter








--
Peter Kietzmann

Hamburg University of Applied Sciences
Dept. Informatik, Internet Technologies Group
Berliner Tor 7, 20099 Hamburg, Germany
Fon: +49-40-42875-8426
Web: http://www.haw-hamburg.de/inet


Re: Cortex support for OpenISA VEGAboard?

Henrik Brix Andersen
 

Hi Peter,

Until recently there was an open draft PR adding support for the CM4 core within the RV32M1:
https://github.com/zephyrproject-rtos/zephyr/pull/27497

Unfortunately it was closed due to inactivity.

Regards,
Brix
--
Henrik Brix Andersen

On 4 Nov 2020, at 12.15, Peter Kietzmann <peter.kietzmann@haw-hamburg.de> wrote:

Dear community,

is there support for operating the OpenISA VEGAboard with the Cortex M4F
or Cortex M0+ processors? If yes, can someone point me to the
development procedure? If no, is anyone working on that?

Cheers
Peter





Cortex support for OpenISA VEGAboard?

Peter Kietzmann
 

Dear community,

is there support for operating the OpenISA VEGAboard with the Cortex M4F
or Cortex M0+ processors? If yes, can someone point me to the
development procedure? If no, is anyone working on that?

Cheers
Peter


Re: set a pin as out

Erwan Gouriou
 

Hi Sarvg,

To configure a pin in a gpio mode, please have a look to the gpio API (you'll find exemples under tests/drivers/gpio)

Chevets
Erwan


Le mar. 3 nov. 2020 à 18:49, <sarvg@...> a écrit :
Hello,
How can i set an gpio pin as output? Is there any examples or tutorials for this?
For example
PIN: PB_12 in St nucleo H743zi2
 
Thanks for your help
 
sarvg 


Re: MCUboot placed to immutable flash #nrf52840 #crypto #dts

Bolivar, Marti
 

In general, that's left as an exercise for the user, as far as I know.

"Nikos Karamolegkos via lists.zephyrproject.org"
<nkaram=ics.forth.gr@lists.zephyrproject.org> writes:

Hello, I am studying this ( https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.zephyrproject.org%2Fmcuboot-security-part-1%2F&;data=04%7C01%7Cmarti.bolivar%40nordicsemi.no%7C5786fbc8d5064bb910c308d87f42f246%7C28e5afa2bf6f419a8cf6b31c6e9e5e8d%7C0%7C0%7C637399274195312166%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=kj5gkT%2BTyB7To%2BLmZE%2FvKojeHKTTTW3Sqd%2FL%2F91Wx50%3D&amp;reserved=0 ) which mentions that the MCUboot is placed to immutable section of flash. How is this implemented? I can not see anywhere information about immutable MCUboot partition.


381 - 400 of 2705