Date   

Re: Changing partitions in a DTS overlay

Martin Kozusky
 

Hi,
this is how my overlay looks like (and it's working) - I wanted to make storage partition smaller and add 2 more partitions. Since I didn't change image0,1 and scratch size, I didn't have to use overlay when compiling mcuboot. Changing slot0 and 1 size should be similar, but I think this time you will have to use the overlay also when compiling mcuboot.

/delete-node/ &storage_partition;

&flash0 {
 partitions {
  compatible = "fixed-partitions";
 
   info_partition: partition@7a000 {
    label = "info";
    reg = <0x0007a000 0x00001000>;
   };
   
    nvs_partition: partition@7b000 {
    label = "nvs";
    reg = <0x0007b000 0x00002000>;
   };
   
   storage_partition: partition@7d000 {
    label = "storage";
    reg = <0x0007d000 0x00003000>;
   };
 
  };
 };

Martin

Dne 27.03.2020 v 22:33 Lawrence King napsal(a):

Dear all:

 

I am trying to change the partition table from the default as defined in the board file inside Zephyr to a slightly different configuration. Obviously I could do this by editing the file in the zephyr tree but this has the disadvantage that I have to redo the change each time I upgrade the kernel. Hence I would like to make the change in the overlay. Here is what I did in the overlay:

 

&flash0 {

        /*

         * For more information, see:

         * http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions

         */

        partitions {

                compatible = "fixed-partitions";

                #address-cells = <1>;

                #size-cells = <1>;

 

                boot_partition: partition@0 {

                        label = "mcuboot";

                        reg = <0x000000000 0x0000C000>;

                };

/*

                slot0_partition: partition@c000 {

                        label = "image-0";

                        reg = <0x0000C000 0x000067000>;

                };

                slot1_partition: partition@73000 {

                        label = "image-1";

                        reg = <0x00073000 0x000067000>;

                };

                scratch_partition: partition@da000 {

                        label = "image-scratch";

                        reg = <0x000da000 0x0001c000>;

                };

*/

                slot0_partition: partition@c000 {

                        label = "image-0";

                        reg = <0x0000C000 0x000075800>;

                };

                slot1_partition: partition@81800 {

                        label = "image-1";

                        reg = <0x00081800 0x000075800>;

                };

 

                /*

                 * The flash starting at 0x000f8000 and ending at (32kB)

                 * 0x000fffff is reserved for use by the application.

                 */

 

                /* Storage partition will be used by FCB/NFFS/NVS if enabled. */

                storage_partition: partition@f8000 {

                        label = "storage";

                        reg = <0x000f8000 0x00008000>;

                };

        };

};

 

As you can see I commented out the definitions of slot0, slot1 and scratch, then I added in new definitions for slot0 and slot1. When I attempt to compile this I get a fatal error:

 

nrf52840_mdk.dts.pre.tmp:546.50-549.19: ERROR (duplicate_label): /soc/flash-controller@4001e000/flash@0/partitions/partition@81800: Duplicate label 'slot1_partition' on /soc/flash-controller@4001e000/flash@0/partitions/partition@81800 and /soc/flash-controller@4001e000/flash@0/partitions/partition@73000

ERROR: Input tree has errors, aborting (use -f to force output)

 

The device tree compile didn’t mind changing the size of the slot0 partition, but it hated changing the base address of the slot1 partition.

 

I tried leaving the partition address at 73000, it compiles, but the device tree compiler complains “warning: unit-address and first reg (0x81800) don't match for partition@73000” and mcuboot complains “<wrn> mcuboot: Cannot upgrade: slots don't have same amount of sectors”.

I also tried many variations on adding /delete-node/ and /delete-property/ in front of the definitions but this just gave me other errors.

 

Obviously I am going about this incorrectly. What is the right way to change the partition table in a device tree overlay?

 

Lawrence King

Principal Developer

Connected Transport Market Unit

https://www.Irdeto.com

+1(416)627-7302

 

1  2 -
                linkedin  3 -
                instagram  4 -
                youtube  6
                - facebook  7

            

CONFIDENTIAL: This e-mail and any attachments are confidential and intended solely for the use of the individual(s) to whom it is addressed. It can contain proprietary confidential information and be subject to legal privilege and/or subject to a non-disclosure Agreement. Unauthorized use, disclosure or copying is strictly prohibited. If you are not the/an addressee and are in possession of this e-mail, please delete the message and notify us immediately. Please consider the environment before printing this e-mail. Thank you.

 

 

 



Changing partitions in a DTS overlay

Lawrence King
 

Dear all:

 

I am trying to change the partition table from the default as defined in the board file inside Zephyr to a slightly different configuration. Obviously I could do this by editing the file in the zephyr tree but this has the disadvantage that I have to redo the change each time I upgrade the kernel. Hence I would like to make the change in the overlay. Here is what I did in the overlay:

 

&flash0 {

        /*

         * For more information, see:

         * http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions

         */

        partitions {

                compatible = "fixed-partitions";

                #address-cells = <1>;

                #size-cells = <1>;

 

                boot_partition: partition@0 {

                        label = "mcuboot";

                        reg = <0x000000000 0x0000C000>;

                };

/*

                slot0_partition: partition@c000 {

                        label = "image-0";

                        reg = <0x0000C000 0x000067000>;

                };

                slot1_partition: partition@73000 {

                        label = "image-1";

                        reg = <0x00073000 0x000067000>;

                };

                scratch_partition: partition@da000 {

                        label = "image-scratch";

                        reg = <0x000da000 0x0001c000>;

                };

*/

                slot0_partition: partition@c000 {

                        label = "image-0";

                        reg = <0x0000C000 0x000075800>;

                };

                slot1_partition: partition@81800 {

                        label = "image-1";

                        reg = <0x00081800 0x000075800>;

                };

 

                /*

                 * The flash starting at 0x000f8000 and ending at (32kB)

                 * 0x000fffff is reserved for use by the application.

                 */

 

                /* Storage partition will be used by FCB/NFFS/NVS if enabled. */

                storage_partition: partition@f8000 {

                        label = "storage";

                        reg = <0x000f8000 0x00008000>;

                };

        };

};

 

As you can see I commented out the definitions of slot0, slot1 and scratch, then I added in new definitions for slot0 and slot1. When I attempt to compile this I get a fatal error:

 

nrf52840_mdk.dts.pre.tmp:546.50-549.19: ERROR (duplicate_label): /soc/flash-controller@4001e000/flash@0/partitions/partition@81800: Duplicate label 'slot1_partition' on /soc/flash-controller@4001e000/flash@0/partitions/partition@81800 and /soc/flash-controller@4001e000/flash@0/partitions/partition@73000

ERROR: Input tree has errors, aborting (use -f to force output)

 

The device tree compile didn’t mind changing the size of the slot0 partition, but it hated changing the base address of the slot1 partition.

 

I tried leaving the partition address at 73000, it compiles, but the device tree compiler complains “warning: unit-address and first reg (0x81800) don't match for partition@73000” and mcuboot complains “<wrn> mcuboot: Cannot upgrade: slots don't have same amount of sectors”.

I also tried many variations on adding /delete-node/ and /delete-property/ in front of the definitions but this just gave me other errors.

 

Obviously I am going about this incorrectly. What is the right way to change the partition table in a device tree overlay?

 

Lawrence King

Principal Developer

Connected Transport Market Unit

https://www.Irdeto.com

+1(416)627-7302

 

1  2 - linkedin  3 - instagram  4 - youtube  6 - facebook  7

            

CONFIDENTIAL: This e-mail and any attachments are confidential and intended solely for the use of the individual(s) to whom it is addressed. It can contain proprietary confidential information and be subject to legal privilege and/or subject to a non-disclosure Agreement. Unauthorized use, disclosure or copying is strictly prohibited. If you are not the/an addressee and are in possession of this e-mail, please delete the message and notify us immediately. Please consider the environment before printing this e-mail. Thank you.

 

 

 


Re: tracing using HW support (ETM, ARM CoreSight)

Kevin Townsend
 

Hi Roman,

My request is - If someone has any info regarding this matter, namely - how to do this, examples, info, - please share it.

It isn't something I've used myself, but you can access TRACE functionality from JLinkExe on the command-line with an appropriate J-Trace debugger.

Checking the list of commands from the tool, I can see:

---- TRACE -----------
TClear     TRACE - Clear buffer
TSetSize   TRACE - Set Size of trace buffer
TSetFormat TRACE - SetFormat
TSR        TRACE - Show Regions (and analyze trace buffer)
TStart     TRACE - Start
TStop      TRACE - Stop

Another platform-neutral option is the free (if you have a supported debugger, which the J-Trace is) Ozone graphical debug tool from Segger, which you can use to point to a Zephyr image, and then access the trace features from the Tools > Trace Settings menu item, setting the source to Trace Pins.

Best regards,
Kevin


tracing using HW support (ETM, ARM CoreSight)

roman.fedoryak@...
 

Hello all,
We are developing SW for medical devices. Obviously we have specific requirements for code certification - we need to do detailed unit tests, gather Code Coverage, etc. We do this with instruction trace features supported by ETM (embedded trace macrocell) from ARM CoreSight Architecture of Cortex microcontrollers, and TraceData pins for data transmission. This feature is supported by Segger HW debuggers and also by "major" IDEs like Keil's MDK-ARM.
But I have not found any notes about such sort of tracing in Zephyr's docs. Averything I see is discussions about Segger SystemView, RTT console - yes, these are tracing tools, but only SW tracing, with no ETM involvement.

My request is - If someone has any info regarding this matter, namely - how to do this, examples, info, - please share it.

Best Regards,
Roman Fedoryak.


Re: for board nucleo_f302r8, where "stm32f3xx.h" header file needs to be? #stm32

MaxMn
 

Bingo! Thanks, Erwan
I'm watching now how "west update" is fetching repositories.

Am Di., 24. März 2020 um 22:52 Uhr schrieb Erwan Gouriou <erwan.gouriou@...>:

You might just miss a "west update".


Le mar. 24 mars 2020 à 19:19, Yannis Damigos <giannis.damigos@...> a écrit :
Hi,

just tried it and it works fine on my system.

are the modules installed?
You could check using: west list | grep hal_stm32

Best regards,
Yannis

On 3/24/20 5:41 PM, MaxMn via Lists.Zephyrproject.Org wrote:
> I'm running
>   ~/zephyrproject/zephyr$ west build -p auto -b nucleo_f302r8 samples/basic/blinky
>
> What is the proper location of stm32f3xx.h? I got it within so called "STM32Cube MCU Package for STM32F3 Series" STM32CubeF3 (https://www.st.com/content/st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32cube-mcu-mpu-packages/stm32cubef3.html)
>
> -- west build: building application
> [1/115] Preparing syscall dependency handling
>
> [7/115] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
> FAILED: zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
> ccache /home/user/zephyr-sdk-0.11.2/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
>  -DBUILD_VERSION=zephyr-v2.2.0-561-g67e4ccbc5161
>  -DKERNEL
>  -D_FORTIFY_SOURCE=2
>  -D__ZEPHYR__=1
>  -I../kernel/include
>  -I../arch/arm/include
>  -I../include
>  -Izephyr/include/generated
>  -I../soc/arm/st_stm32/stm32f3
>  -I../drivers
>  -isystem ../lib/libc/minimal/include
>  -isystem /home/user/zephyr-sdk-0.11.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/include
>  -isystem /home/user/zephyr-sdk-0.11.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/include-fixed
>  -Os
>  -imacros/home/user/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h
>  -ffreestanding -fno-common -g -mcpu=cortex-m4 -mthumb
>  -imacros/home/user/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h
>  -Wall
>  -Wformat
>  -Wformat-security
>  -Wno-format-zero-length
>  -Wno-main
>  -Wno-address-of-packed-member
>  -Wno-pointer-sign
>  -Wpointer-arith
>  -Wno-unused-but-set-variable
>  -Werror=implicit-int
>  -fno-asynchronous-unwind-tables
>  -fno-pie
>  -fno-pic
>  -fno-strict-overflow
>  -fno-reorder-functions
>  -fno-defer-pop
>  -fmacro-prefix-map=/home/user/zephyrproject/zephyr/samples/basic/blinky=CMAKE_SOURCE_DIR
>  -fmacro-prefix-map=/home/user/zephyrproject/zephyr=ZEPHYR_BASE
>  -fmacro-prefix-map=/home/user/zephyrproject=WEST_TOPDIR
>  -ffunction-sections
>  -fdata-sections
>  -mabi=aapcs
>  -march=armv7e-m
>  -std=c99
>  -nostdinc
>  -MD
>  -MT zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
>  -MF zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj.d
>  -o zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj  
>  -c /home/user/zephyrproject/zephyr/arch/arm/core/offsets/offsets.c
>  
> In file included from ../include/arch/arm/aarch32/cortex_m/cmsis.h:17,
>                  from ../arch/arm/include/aarch32/cortex_m/stack.h:23,
>                  from ../arch/arm/include/kernel_arch_data.h:33,
>                  from /home/user/zephyrproject/zephyr/arch/arm/core/offsets/offsets_aarch32.c:26,
>                  from /home/user/zephyrproject/zephyr/arch/arm/core/offsets/offsets.c:12:
> ../soc/arm/st_stm32/stm32f3/soc.h:24:10: fatal error: stm32f3xx.h: No such file or directory
>    24 | #include <stm32f3xx.h>
>       |          ^~~~~~~~~~~~~
> compilation terminated.
> ninja: build stopped: subcommand failed.
>





Re: for board nucleo_f302r8, where "stm32f3xx.h" header file needs to be? #stm32

Erwan Gouriou
 

You might just miss a "west update".


Le mar. 24 mars 2020 à 19:19, Yannis Damigos <giannis.damigos@...> a écrit :
Hi,

just tried it and it works fine on my system.

are the modules installed?
You could check using: west list | grep hal_stm32

Best regards,
Yannis

On 3/24/20 5:41 PM, MaxMn via Lists.Zephyrproject.Org wrote:
> I'm running
>   ~/zephyrproject/zephyr$ west build -p auto -b nucleo_f302r8 samples/basic/blinky
>
> What is the proper location of stm32f3xx.h? I got it within so called "STM32Cube MCU Package for STM32F3 Series" STM32CubeF3 (https://www.st.com/content/st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32cube-mcu-mpu-packages/stm32cubef3.html)
>
> -- west build: building application
> [1/115] Preparing syscall dependency handling
>
> [7/115] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
> FAILED: zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
> ccache /home/user/zephyr-sdk-0.11.2/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
>  -DBUILD_VERSION=zephyr-v2.2.0-561-g67e4ccbc5161
>  -DKERNEL
>  -D_FORTIFY_SOURCE=2
>  -D__ZEPHYR__=1
>  -I../kernel/include
>  -I../arch/arm/include
>  -I../include
>  -Izephyr/include/generated
>  -I../soc/arm/st_stm32/stm32f3
>  -I../drivers
>  -isystem ../lib/libc/minimal/include
>  -isystem /home/user/zephyr-sdk-0.11.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/include
>  -isystem /home/user/zephyr-sdk-0.11.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/include-fixed
>  -Os
>  -imacros/home/user/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h
>  -ffreestanding -fno-common -g -mcpu=cortex-m4 -mthumb
>  -imacros/home/user/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h
>  -Wall
>  -Wformat
>  -Wformat-security
>  -Wno-format-zero-length
>  -Wno-main
>  -Wno-address-of-packed-member
>  -Wno-pointer-sign
>  -Wpointer-arith
>  -Wno-unused-but-set-variable
>  -Werror=implicit-int
>  -fno-asynchronous-unwind-tables
>  -fno-pie
>  -fno-pic
>  -fno-strict-overflow
>  -fno-reorder-functions
>  -fno-defer-pop
>  -fmacro-prefix-map=/home/user/zephyrproject/zephyr/samples/basic/blinky=CMAKE_SOURCE_DIR
>  -fmacro-prefix-map=/home/user/zephyrproject/zephyr=ZEPHYR_BASE
>  -fmacro-prefix-map=/home/user/zephyrproject=WEST_TOPDIR
>  -ffunction-sections
>  -fdata-sections
>  -mabi=aapcs
>  -march=armv7e-m
>  -std=c99
>  -nostdinc
>  -MD
>  -MT zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
>  -MF zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj.d
>  -o zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj  
>  -c /home/user/zephyrproject/zephyr/arch/arm/core/offsets/offsets.c
>  
> In file included from ../include/arch/arm/aarch32/cortex_m/cmsis.h:17,
>                  from ../arch/arm/include/aarch32/cortex_m/stack.h:23,
>                  from ../arch/arm/include/kernel_arch_data.h:33,
>                  from /home/user/zephyrproject/zephyr/arch/arm/core/offsets/offsets_aarch32.c:26,
>                  from /home/user/zephyrproject/zephyr/arch/arm/core/offsets/offsets.c:12:
> ../soc/arm/st_stm32/stm32f3/soc.h:24:10: fatal error: stm32f3xx.h: No such file or directory
>    24 | #include <stm32f3xx.h>
>       |          ^~~~~~~~~~~~~
> compilation terminated.
> ninja: build stopped: subcommand failed.
>





Re: for board nucleo_f302r8, where "stm32f3xx.h" header file needs to be? #stm32

Yannis Damigos
 

Hi,

just tried it and it works fine on my system.

are the modules installed?
You could check using: west list | grep hal_stm32

Best regards,
Yannis

On 3/24/20 5:41 PM, MaxMn via Lists.Zephyrproject.Org wrote:
I'm running
  ~/zephyrproject/zephyr$ west build -p auto -b nucleo_f302r8 samples/basic/blinky

What is the proper location of stm32f3xx.h? I got it within so called "STM32Cube MCU Package for STM32F3 Series" STM32CubeF3 (https://www.st.com/content/st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32cube-mcu-mpu-packages/stm32cubef3.html)

-- west build: building application
[1/115] Preparing syscall dependency handling

[7/115] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
FAILED: zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
ccache /home/user/zephyr-sdk-0.11.2/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
 -DBUILD_VERSION=zephyr-v2.2.0-561-g67e4ccbc5161
 -DKERNEL
 -D_FORTIFY_SOURCE=2
 -D__ZEPHYR__=1
 -I../kernel/include
 -I../arch/arm/include
 -I../include
 -Izephyr/include/generated
 -I../soc/arm/st_stm32/stm32f3
 -I../drivers
 -isystem ../lib/libc/minimal/include
 -isystem /home/user/zephyr-sdk-0.11.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/include
 -isystem /home/user/zephyr-sdk-0.11.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/include-fixed
 -Os
 -imacros/home/user/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h
 -ffreestanding -fno-common -g -mcpu=cortex-m4 -mthumb
 -imacros/home/user/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h
 -Wall
 -Wformat
 -Wformat-security
 -Wno-format-zero-length
 -Wno-main
 -Wno-address-of-packed-member
 -Wno-pointer-sign
 -Wpointer-arith
 -Wno-unused-but-set-variable
 -Werror=implicit-int
 -fno-asynchronous-unwind-tables
 -fno-pie
 -fno-pic
 -fno-strict-overflow
 -fno-reorder-functions
 -fno-defer-pop
 -fmacro-prefix-map=/home/user/zephyrproject/zephyr/samples/basic/blinky=CMAKE_SOURCE_DIR
 -fmacro-prefix-map=/home/user/zephyrproject/zephyr=ZEPHYR_BASE
 -fmacro-prefix-map=/home/user/zephyrproject=WEST_TOPDIR
 -ffunction-sections
 -fdata-sections
 -mabi=aapcs
 -march=armv7e-m
 -std=c99
 -nostdinc
 -MD
 -MT zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
 -MF zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj.d
 -o zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj  
 -c /home/user/zephyrproject/zephyr/arch/arm/core/offsets/offsets.c
 
In file included from ../include/arch/arm/aarch32/cortex_m/cmsis.h:17,
                 from ../arch/arm/include/aarch32/cortex_m/stack.h:23,
                 from ../arch/arm/include/kernel_arch_data.h:33,
                 from /home/user/zephyrproject/zephyr/arch/arm/core/offsets/offsets_aarch32.c:26,
                 from /home/user/zephyrproject/zephyr/arch/arm/core/offsets/offsets.c:12:
../soc/arm/st_stm32/stm32f3/soc.h:24:10: fatal error: stm32f3xx.h: No such file or directory
   24 | #include <stm32f3xx.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


for board nucleo_f302r8, where "stm32f3xx.h" header file needs to be? #stm32

MaxMn
 

I'm running
  ~/zephyrproject/zephyr$ west build -p auto -b nucleo_f302r8 samples/basic/blinky

What is the proper location of stm32f3xx.h? I got it within so called "STM32Cube MCU Package for STM32F3 Series" STM32CubeF3 (https://www.st.com/content/st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32cube-mcu-mpu-packages/stm32cubef3.html)

-- west build: building application
[1/115] Preparing syscall dependency handling

[7/115] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
FAILED: zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
ccache /home/user/zephyr-sdk-0.11.2/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
 -DBUILD_VERSION=zephyr-v2.2.0-561-g67e4ccbc5161
 -DKERNEL
 -D_FORTIFY_SOURCE=2
 -D__ZEPHYR__=1
 -I../kernel/include
 -I../arch/arm/include
 -I../include
 -Izephyr/include/generated
 -I../soc/arm/st_stm32/stm32f3
 -I../drivers
 -isystem ../lib/libc/minimal/include
 -isystem /home/user/zephyr-sdk-0.11.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/include
 -isystem /home/user/zephyr-sdk-0.11.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/include-fixed
 -Os
 -imacros/home/user/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h
 -ffreestanding -fno-common -g -mcpu=cortex-m4 -mthumb
 -imacros/home/user/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h
 -Wall
 -Wformat
 -Wformat-security
 -Wno-format-zero-length
 -Wno-main
 -Wno-address-of-packed-member
 -Wno-pointer-sign
 -Wpointer-arith
 -Wno-unused-but-set-variable
 -Werror=implicit-int
 -fno-asynchronous-unwind-tables
 -fno-pie
 -fno-pic
 -fno-strict-overflow
 -fno-reorder-functions
 -fno-defer-pop
 -fmacro-prefix-map=/home/user/zephyrproject/zephyr/samples/basic/blinky=CMAKE_SOURCE_DIR
 -fmacro-prefix-map=/home/user/zephyrproject/zephyr=ZEPHYR_BASE
 -fmacro-prefix-map=/home/user/zephyrproject=WEST_TOPDIR
 -ffunction-sections
 -fdata-sections
 -mabi=aapcs
 -march=armv7e-m
 -std=c99
 -nostdinc
 -MD
 -MT zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
 -MF zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj.d
 -o zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj  
 -c /home/user/zephyrproject/zephyr/arch/arm/core/offsets/offsets.c
 
In file included from ../include/arch/arm/aarch32/cortex_m/cmsis.h:17,
                 from ../arch/arm/include/aarch32/cortex_m/stack.h:23,
                 from ../arch/arm/include/kernel_arch_data.h:33,
                 from /home/user/zephyrproject/zephyr/arch/arm/core/offsets/offsets_aarch32.c:26,
                 from /home/user/zephyrproject/zephyr/arch/arm/core/offsets/offsets.c:12:
../soc/arm/st_stm32/stm32f3/soc.h:24:10: fatal error: stm32f3xx.h: No such file or directory
   24 | #include <stm32f3xx.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.


python tools when conda virtual environments are used

MaxMn
 

I'm using conda virtual environments (conda 4.8.0rc0, installed within miniconda in my case).

To get west build working, I had to activate the intended conda environment prior to (re-)installing west and tools from requirements.txt.
conda create --clone base --name zephyr
source activate zephyr
pip install west
pip install -r ~/zephyrproject/zephyr/scripts/requirements.txt

I also had to edit ~/zephyrproject/zephyr/build/CMakeCache.txt and point PYTHON_EXECUTABLE:FILEPATH and WEST:FILEPATH to respective executables under in the right conda env. Maybe it wouldn't be necessary if didn't forget to activate the conda env before installing west and requirements first time.

I wonder if conda virtual envs are worth mentioning in Getting Started.

And I can move on to troubleshooting missing stm32f3xx.h for board nucleo_f302r8
../soc/arm/st_stm32/stm32f3/soc.h:24:10: fatal error: stm32f3xx.h: No such file or directory
   24 | #include <stm32f3xx.h>


Re: is using of arm toolchain from developer.arm.com feasible?

Kumar Gala
 

No need to worry about dirty, its just because we have our own patches to crosstool-ng.

You can use developer.arm.com if you want, take a look here for the instructions on 'GNU ARM Embedded':

https://docs.zephyrproject.org/latest/getting_started/toolchain_3rd_party_x_compilers.html?highlight=toolchain

On Mar 24, 2020, at 6:29 AM, MaxMn via Lists.Zephyrproject.Org <anzeigen.21423+zephyr=googlemail.com@lists.zephyrproject.org> wrote:

After installing zephyr-sdk-0.11.2, I checked arm g++ version:
arm-zephyr-eabi-g++ (crosstool-NG 1.24.0.37-3f461da-dirty) 9.2.0
Why "dirty"? Should I worry?

How feasible is it to use the a toolchain direct from developer.arm.com (1) when buliding zephyr projects?

More general, why vendors tend to supply their own toolchain builds? (My target is STM32. ST goes way "further" and supplies with their STM32CubeIDE old GNU Tools for STM32 7-2018-q2-update.20190328-1800 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907])

(1) https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads


is using of arm toolchain from developer.arm.com feasible?

MaxMn
 

After installing zephyr-sdk-0.11.2, I checked arm g++ version:
arm-zephyr-eabi-g++ (crosstool-NG 1.24.0.37-3f461da-dirty) 9.2.0
Why "dirty"? Should I worry?

How feasible is it to use the a toolchain direct from developer.arm.com (1) when buliding zephyr projects?

More general, why vendors tend to supply their own toolchain builds? (My target is STM32. ST goes way "further" and supplies with their STM32CubeIDE old GNU Tools for STM32 7-2018-q2-update.20190328-1800 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907])


is using of arm toolchain from developer.arm.com feasible?

MaxMn
 

After installing zephyr-sdk-0.11.2, I checked arm g++ version:
arm-zephyr-eabi-g++ (crosstool-NG 1.24.0.37-3f461da-dirty) 9.2.0
Why "dirty"? Should I worry?

How feasible is it to use the a toolchain direct from developer.arm.com (1) when buliding zephyr projects?

More general, why vendors tend to supply their own toolchain builds? (My target is STM32. ST goes way "further" and supplies with their STM32CubeIDE old GNU Tools for STM32 7-2018-q2-update.20190328-1800 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907])


API meeting: agenda

Carles Cufi
 

Hi all,

Note: This is the last week where the meeting takes place at 17h CET. Next week we go back to 18h CET.

Today's topics:

- How to document standalone drivers like the enc28j60 (Piotr)

- Upgrade the hwinfo API to stable
- PR: https://github.com/zephyrproject-rtos/zephyr/pull/23661

- RTC API proposal
- PR: https://github.com/zephyrproject-rtos/zephyr/pull/23526/commits/2880ee02b0f2fd91d897d8a11a4cbdefe87a19b0

- Naming in the async_notify module
- PR: https://github.com/zephyrproject-rtos/zephyr/pull/23601

Additional items in the "Triage" column in the GitHub project may be discussed if time permits.
If you want an item included in the meeting, please add it to the GitHub project.

https://github.com/zephyrproject-rtos/zephyr/wiki/Zephyr-Committee-and-Working-Group-Meetings#zephyr-api-discussion
https://github.com/zephyrproject-rtos/zephyr/projects/18
https://docs.google.com/document/d/1lv-8B5QE2m4FjBcvfqAXFIgQfW5oz6306zJ7GIZIWCk/edit

Regards,

Carles


Re: unable to build #west

Bolivar, Marti
 

You appear to be using Python 3.5. Zephyr requires Python 3.6.

I am surprised the build got this far along. You should have seen an
error about this earlier.

"Stefan Hristozov via Lists.Zephyrproject.Org"
<stefan.hristozov=aisec.fraunhofer.de@lists.zephyrproject.org> writes:

When I try to build my project I get the following error:

$ west build -b native_posix
Traceback (most recent call last):
File "/home/stefan/.local/bin/west", line 11, in <module>
sys.exit(main())
File "/home/stefan/.local/lib/python3.5/site-packages/west/main.py", line 583, in main
args.handler(args, unknown)
File "/home/stefan/.local/lib/python3.5/site-packages/west/main.py", line 324, in ext_command_handler
command = spec.factory()
File "/home/stefan/.local/lib/python3.5/site-packages/west/commands/__init__.py", line 365, in __call__
mod = _commands_module_from_file(self.py_file)
File "/home/stefan/.local/lib/python3.5/site-packages/west/commands/__init__.py", line 333, in _commands_module_from_file
mod = _import_mod_from(mod_name, file)
File "/home/stefan/.local/lib/python3.5/site-packages/west/commands/__init__.py", line 330, in _import_mod_from
spec.loader.exec_module(mod)
File "<frozen importlib._bootstrap_external>", line 673, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/scripts/west_commands/build.py", line 16, in <module>
from zephyr_ext_common import Forceable
File "/home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/scripts/west_commands/zephyr_ext_common.py", line 17, in <module>
from runners.core import RunnerConfig
File "/home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/scripts/west_commands/runners/__init__.py", line 24, in <module>
from runners import nrfjprog
File "/home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/scripts/west_commands/runners/nrfjprog.py", line 86
f'refusing to guess which of {len(snrs)} '

It appears to be something with nrfjprog.py. Any ideas what can be wrong?


unable to build #west

Stefan Hristozov
 

When I try to build my project I get the following error:

$ west build -b native_posix
Traceback (most recent call last):
  File "/home/stefan/.local/bin/west", line 11, in <module>
    sys.exit(main())
  File "/home/stefan/.local/lib/python3.5/site-packages/west/main.py", line 583, in main
    args.handler(args, unknown)
  File "/home/stefan/.local/lib/python3.5/site-packages/west/main.py", line 324, in ext_command_handler
    command = spec.factory()
  File "/home/stefan/.local/lib/python3.5/site-packages/west/commands/__init__.py", line 365, in __call__
    mod = _commands_module_from_file(self.py_file)
  File "/home/stefan/.local/lib/python3.5/site-packages/west/commands/__init__.py", line 333, in _commands_module_from_file
    mod = _import_mod_from(mod_name, file)
  File "/home/stefan/.local/lib/python3.5/site-packages/west/commands/__init__.py", line 330, in _import_mod_from
    spec.loader.exec_module(mod)
  File "<frozen importlib._bootstrap_external>", line 673, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/scripts/west_commands/build.py", line 16, in <module>
    from zephyr_ext_common import Forceable
  File "/home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/scripts/west_commands/zephyr_ext_common.py", line 17, in <module>
    from runners.core import RunnerConfig
  File "/home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/scripts/west_commands/runners/__init__.py", line 24, in <module>
    from runners import nrfjprog
  File "/home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/scripts/west_commands/runners/nrfjprog.py", line 86
    f'refusing to guess which of {len(snrs)} '


It appears to be something with nrfjprog.py. Any ideas what can be wrong?


Re: Enable traces on Serial Wire Output #debugging

David K
 

And I forgot to include the FreeRTOS part:

#define configCPU_CLOCK_HZ                      ( SystemCoreClock )
#define configTICK_RATE_HZ                      ( 1000 )

Where SystemCoreClock is set to 16000000 by default.


Re: Enable traces on Serial Wire Output #debugging

David K
 

Hi there,

Thanks for the feedback and sorry for the delay. Here is my function that initializes the clock, it is called right after HAL_Init():

    // Configure the main internal regulator output voltage
    __IO uint32_t tmpreg;
    SET_BIT(RCC->APB1ENR, RCC_APB1ENR_PWREN);

    // Delay after an RCC peripheral clock enabling
    tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_PWREN);
    tmpreg = tmpreg;

    MODIFY_REG(PWR->CR1, PWR_CR1_VOS, (PWR_REGULATOR_VOLTAGE_SCALE3));

    // Delay after an RCC peripheral clock enabling
    tmpreg = READ_BIT(PWR->CR1, PWR_CR1_VOS);
    tmpreg = tmpreg;

    // Initializes the CPU, AHB and APB busses clocks
    RCC_OscInitTypeDef RCC_OscInitStruct = {0};
    RCC_OscInitStruct.OscillatorType      = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSE;
    RCC_OscInitStruct.HSEState            = RCC_HSE_ON;
    RCC_OscInitStruct.HSIState            = RCC_HSI_ON;
    RCC_OscInitStruct.HSICalibrationValue = 16;
    RCC_OscInitStruct.PLL.PLLState        = RCC_PLL_ON;
    RCC_OscInitStruct.PLL.PLLSource       = RCC_PLLSOURCE_HSE;
    RCC_OscInitStruct.PLL.PLLM            = 8;
    RCC_OscInitStruct.PLL.PLLN            = 144;
    RCC_OscInitStruct.PLL.PLLP            = RCC_PLLP_DIV2;
    RCC_OscInitStruct.PLL.PLLQ            = 6;
    HAL_StatusTypeDef hal_ret = HAL_RCC_OscConfig(&RCC_OscInitStruct);
    if (hal_ret != HAL_OK)
    {
        return -ENOTSUP;
    }

    // Initializes the CPU, AHB and APB busses clocks
    RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
    RCC_ClkInitStruct.ClockType      = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
    RCC_ClkInitStruct.SYSCLKSource   = RCC_SYSCLKSOURCE_PLLCLK;
    RCC_ClkInitStruct.AHBCLKDivider  = RCC_SYSCLK_DIV1;
    RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
    RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
    // HAL_RCC_ClockConfig() ultimately calls HAL_InitTick()
    hal_ret = HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4);
    if (hal_ret != HAL_OK)
    {
        return -ENOTSUP;
    }

    // Initializes the peripherals clocks
    RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
    PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USART6 | RCC_PERIPHCLK_SDMMC1 | RCC_PERIPHCLK_CLK48;
    PeriphClkInitStruct.Usart6ClockSelection = RCC_USART6CLKSOURCE_HSI;
    PeriphClkInitStruct.Clk48ClockSelection  = RCC_CLK48SOURCE_PLL;
    PeriphClkInitStruct.Sdmmc1ClockSelection = RCC_SDMMC1CLKSOURCE_CLK48;
    hal_ret = HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
    if (hal_ret != HAL_OK)
    {
        return -ENOTSUP;
    }

    // Configure the Systick IRQ for FreeRTOS timebase
    HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000);
    // Configure the Systick
    HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);

    // SysTick_IRQn interrupt configuration done in HAL_MspInit()

    SCB_EnableICache();
    SCB_EnableDCache();

    return 0;

Also, not sure if it is related but I have 2 Time bases:

  • STM32 uses timers (TIM6) to generate interruptions for HAL
  • FreeRTOS uses SysTick for OS functions

Thanks for your help, in parallel I will look into RTT alternative.


Re: when using zephyr with wolfssl -> error: 'CONFIG_NET_BUF_USER_DATA_SIZE' undeclared here

Johan Hedberg
 

Hi Stefan,

On 18. Mar 2020, at 11.08, Stefan Hristozov <stefan.hristozov@...> wrote:
In file included from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/include/net/net_l2.h:15,
from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/include/net/net_if.h:29,
from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/include/net/net_context.h:27,
from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/include/net/dns_resolve.h:17,
from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/include/net/socket.h:27,
from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/ext/lib/crypto/wolfssl/include/wolfssl/wolfcrypt/settings.h:1480,
from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/ext/lib/crypto/wolfssl/library/wolfcrypt/src/cpuid.c:27:
/home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/include/net/buf.h:528:17: error: 'CONFIG_NET_BUF_USER_DATA_SIZE' undeclared here (not in a function); did you mean 'CONFIG_HEAP_MEM_POOL_SIZE'?
u8_t user_data[CONFIG_NET_BUF_USER_DATA_SIZE] __net_buf_align;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIG_HEAP_MEM_POOL_SIZE
[49/203] Building C object zephyr/arch/arch/arm/core/CMakeFiles/arch__arm__core.dir/prep_c.c.obj

I already have contacted the wolfssl support. According to them it is an zephyr issue.

Have you enabled CONFIG_NET_BUF=y? That’s the only dependency for CONFIG_NET_BUF_USER_DATA_SIZE being defined.

Johan


when using zephyr with wolfssl -> error: 'CONFIG_NET_BUF_USER_DATA_SIZE' undeclared here

Stefan Hristozov
 

Hi
I want to use wolfssl in my zephyr project. My proj.conf looks like that:

CONFIG_ENTROPY_GENERATOR=y
CONFIG_TEST_RANDOM_GENERATOR=y

CONFIG_TINYCBOR=y
CONFIG_WOLFSSL=y


Unfortunately I get this error:

In file included from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/include/net/net_l2.h:15,
from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/include/net/net_if.h:29,
from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/include/net/net_context.h:27,
from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/include/net/dns_resolve.h:17,
from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/include/net/socket.h:27,
from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/ext/lib/crypto/wolfssl/include/wolfssl/wolfcrypt/settings.h:1480,
from /home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/ext/lib/crypto/wolfssl/library/wolfcrypt/src/cpuid.c:27:
/home/stefan/workspaces/zephyrproject/zephyrproject/zephyr/include/net/buf.h:528:17: error: 'CONFIG_NET_BUF_USER_DATA_SIZE' undeclared here (not in a function); did you mean 'CONFIG_HEAP_MEM_POOL_SIZE'?
u8_t user_data[CONFIG_NET_BUF_USER_DATA_SIZE] __net_buf_align;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIG_HEAP_MEM_POOL_SIZE
[49/203] Building C object zephyr/arch/arch/arm/core/CMakeFiles/arch__arm__core.dir/prep_c.c.obj

I already have contacted the wolfssl support. According to them it is an zephyr issue.

Best regards
Stefan


Question about the QSPI flash memory in the nrf52840 PCA10056 board #flash #nrf52840 #spi

henrique.guimaraes@...
 

Good afternoon, I'm a zephyr newbie, trying to implement it into an IoT project!

I'm aware that there is already a driver for the MX25 flash memory device in the nrf's dev kit, but I wasn't able to import it successfully to my code nor was I able to use it properly. I checked in the Menuconfig application and marked every box that had anything to do with QSPI and the NRF's flash drivers, but was still unsuccessful.

How to use the flash device driver properly? I know this is a very newbie question, but I want to do it the right way, not by brute forcing it. 

Thanks.
Regards, Henrique Nascimento Guimarães. Electrical Engineer at VIRTURIAN.

861 - 880 of 2796