Date   

cannot flash zephyr on stm32_min_dev_blue #stm32 #flash

moreaniket219@...
 

ninja flash
[0/1] Flashing stm32_min_dev_blue
-- west flash: using runner openocd
-- runners.openocd: Flashing file: /home/amore/zephyrproject/zephyr/samples/basic/blinky/build/zephyr/zephyr.hex
Open On-Chip Debugger 0.10.0+dev-00992-g3333261df-dirty (2019-08-16-00:14)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
Info : clock speed 1000 kHz
Info : STLINK V2J31S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.259867
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target stm32f1x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
Info : Listening on port 3333 for gdb connections
    TargetName         Type       Endian TapName            State      
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32f1x.cpu       hla_target little stm32f1x.cpu       unknown
Error: mem2array: Read @ 0xe0042004, w=4, cnt=1, failed
/home/amore/zephyr-sdk-0.10.3/sysroots/x86_64-pokysdk-linux/usr/share/openocd/scripts/mem_helper.tcl:6: Error:
in procedure 'ocd_process_reset'
in procedure 'ocd_process_reset_inner' called at file "embedded:startup.tcl", line 251
in procedure 'mmw'
in procedure 'mrw' called at file "/home/amore/zephyr-sdk-0.10.3/sysroots/x86_64-pokysdk-linux/usr/share/openocd/scripts/mem_helper.tcl", line 36
at file "/home/amore/zephyr-sdk-0.10.3/sysroots/x86_64-pokysdk-linux/usr/share/openocd/scripts/mem_helper.tcl", line 6

Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
TARGET: stm32f1x.cpu - Not halted


ERROR: command exited with status 1: /home/amore/zephyr-sdk-0.10.3/sysroots/x86_64-pokysdk-linux/usr/bin/openocd -s /home/amore/zephyr-sdk-0.10.3/sysroots/x86_64-pokysdk-linux/usr/share/openocd/scripts -f /home/amore/zephyrproject/zephyr/boards/arm/stm32_min_dev/support/openocd.cfg -c init -c targets -c 'reset halt' -c 'flash write_image erase /home/amore/zephyrproject/zephyr/samples/basic/blinky/build/zephyr/zephyr.hex' -c 'reset halt' -c 'verify_image /home/amore/zephyrproject/zephyr/samples/basic/blinky/build/zephyr/zephyr.hex' -c 'reset run' -c shutdown
FAILED: zephyr/cmake/flash/CMakeFiles/flash
cd /home/amore/zephyrproject/zephyr/samples/basic/blinky/build && /usr/local/bin/cmake -E env /home/amore/.local/bin/west flash --skip-rebuild
ninja: build stopped: subcommand failed.

Im trying to flash on stm32 min board using ST-Link but it keeps giving me this error.
i have install openocd for the original sites but still keep getting this error.
can someone point me in the right direction.


Re: Adafruit Trinket M0: west flash > How to? #flash #west

William Fish
 

Not completely sure i understand your question but hopefully this will help.

Step 3: west flash
This builds your application then flash your device.

So steps to flash your application are:
Step 1: Identify port

Find port on Linux
  1. Open terminal and type: ls /dev/tty*.

  2. Note the port number listed for /dev/ttyUSB* or /dev/ttyACM*. The port number is represented with * here.

  3. Use the listed port as the serial port. For example: /dev/ttyUSB0.

Step 2: Update the standard config file
This is defined at 'scripts/west_commands/runners/bossac.py' as 
DEFAULT_BOSSAC_PORT = '/dev/ttyACM0'.
Update the port identified in Step 1

Step 3: Build and Flash Board
Run West Flash

If configured correctly West will build and write application to board.

Billy..
 


Re: Adafruit Trinket M0: west flash > How to? #flash #west

Bolivar, Marti
 

Hello,

"yasokada via Lists.Zephyrproject.Org"
<yasokada=gmail.com@...> writes:

Q1. I do not understand why step 3 is necessary.
Q2. If the step 2 is used for flash, how can I change /dev/ttyACM0 to /dev/ttyUSB0 for west flash?
Q3. If step 3 is not relevant to west flash, what is wrong with the above procedure?

I don't have this board, and I can't help you with Q1 or Q3, but for Q2:
you can always run this command to get help on options that are
available to you:

$ west flash --context -d <YOUR_BUILD_DIR>

In this case, you are looking for the --bossac-port option.

Best,
Marti


Adafruit Trinket M0: west flash > How to? #flash #west

@yasokada
 
Edited

My environment:
Ubuntu 18.04 LTS
board: Adafruit Trinket M0
RTOS: Zephyr 2.1.0-rc1

I was trying to use Adafruit Trinket M0.

### connections

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

> Flash
> ...
> 2. Connect the Trinket M0 to your host computer using USB
> 3. 
Connect a 3.3 V USB to serial adapter to the board and to the host. See the Serial Port section above for the board’s pin connections.

With the above step 2, the device is '/dev/ttyACM0'.
With the above step 3, the device may depends on the used "USB to serial adapter". For example, I use some FTDI adapter, which becomes '/dev/ttyUSB0'.

When I try "west flash", the Zephyr will use "/dev/ttyACM0'. 
This is defined at 'scripts/west_commands/runners/bossac.py' as 
DEFAULT_BOSSAC_PORT = '/dev/ttyACM0'.

So, my understanding is that :

> 2. Connect the Trinket M0 to your host computer using USB
is for west flash.

> 3. Connect a 3.3 V USB to serial adapter to the board and to the host. See the Serial Port section above for the board’s pin connections.
is not clear what to use.

With these information, I thought I can flash by using USB connected at the above step 2.

### west flash

I tried to west flash for Trinket M0.

1. connect USB to Trinket M0
2. sudo chmod +777 /dev/ttyACM0 (to add permission to write flash)
3. west flash

I have following error. What is wrong?

```
$ west flash
-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner bossac
bossac: invalid option -- 'o'
Try 'bossac -h' or 'bossac --help' for more information
```

Q1. I do not understand why step 3 is necessary.
Q2. If the step 3 is used for west flash, how can I change /dev/ttyACM0 to /dev/ttyUSB0 for west flash?
Q3. If step 3 is not relevant to west flash, what is wrong with the above procedure?



spi_transceive() does not clock out the SCK for receiving #spi

@yasokada
 

My Environment:
Ubuntu 18.04 LTS
Board: STM32F769 Discovery Kit
RTOS: Zephyr 2.1.0-rc1
Oscilloscope: Analog Discovery 2
SPI device: SRAM memory (23K256)

I am trying to use SPI with my SRAM memory (23K256).
I used spi_transceive() to send and receive with the SRAM memory.
The spi_transceive() can transmit 0x02 0x00 0x10 0xFA with my_spi_tranceive(spi, &spi_cfg, txbufs, 4, NULL, 0);
However, the next spi_transceive() only transmit 0x03 0x00 0x10 with  my_spi_tranceive(spi, &spi_cfg, txbufs, 3, rxbufs, 1);
then, the SCK clock for reading the one byte does not occur.

I also tried by loopbacking the SPI, resulting in same result.

I thought spi_transceive() can send and then receive with SPI device.

What am I missing?

Here is the logic capture when running main.c
(left side is 0x02 0x00 0x10 0xFA, right side is 0x03 0x00 0x10, then without SCK for receiving)




Re: BBC-Microbit PIR sensor #zephyrbluetoothmesh #sensor #ble #bluetoothmesh #gpio

William Fish
 

Hi,
You may want to look at a couple of things to help you answer your own question:

In the zephyr folders;
\boards\arm\bbc_microbit\board.h
It has the list of defines and corresponding pins

The other useful information would be a clear view of the actual physical pins: 
https://tech.microbit.org/hardware/edgeconnector/
I'm sure you will be able to make some progress with this info.

Billy..


Civetweb together with MQTT

Jan Pohanka
 

Hello,
I would like to use web server together with MQTT in same project. 
Unfortunately civetweb sample and MQTT sample have conflicting config requirements with CONFIG_POSIX_API and CONFIG_NET_SOCKETS_POSIX_NAMES.

What would be the right settings here?

best regards
Jan


API meeting: agenda

Carles Cufi
 

Hi all,

This week we will look at:

- PWM, USB and clock_control APIs in the context of stable APIs
- PR: https://github.com/zephyrproject-rtos/zephyr/pull/20657
- PR: https://github.com/zephyrproject-rtos/zephyr/pull/20375
- PR: https://github.com/zephyrproject-rtos/zephyr/issues/20806
- Doc for stable APIs: https://docs.zephyrproject.org/latest/development_process/api_lifecycle.html#stable

- GPIO: Update on progress
- Look at the PRs with driver conversion (https://github.com/zephyrproject-rtos/zephyr/issues/18530)
- Check users of GPIO APIs: https://github.com/zephyrproject-rtos/zephyr/issues/20017
- Tips for converting users can be found here: https://github.com/zephyrproject-rtos/zephyr/issues/20017#issuecomment-549315497 (thanks Peter!)
- Any additional outstanding PRs to topic-gpio

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: Errors generated when build a sample using clang6.0 #west

Kumar Gala
 

On Nov 25, 2019, at 9:49 PM, istuoli@... wrote:

Hello!
I want to build samples/subsys/power/device_pm using clang6.0 so I do as follows:
1、export ZEPHYR_TOOLCHAIN_VARIANT=llvm
2、mkdir build and cd build
3、cmake -DBOARD=reel_board ..
4、make
Then, I got some errors:

[ 95%] Linking C executable zephyr_prebuilt.elf
clang-6.0: warning: argument unused during compilation: '--specs=nosys.specs' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-u _OffsetAbsSyms' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-u _ConfigAbsSyms' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
/usr/local/bin/ld.lld: error: linker.cmd:189: { expected, but got ALIGN_WITH_INPUT
_bt_channels_area : ALIGN_WITH_INPUT SUBALIGN(4)
^
clang-6.0: error: ld.lld command failed with exit code 1 (use -v to see invocation)
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:101: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:557: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Then I turn to west and do:
west build -b reel_board ..
Some similar errors were generated:

[127/132] Linking C executable zephyr/zephyr_prebuilt.elf
FAILED: zephyr/zephyr_prebuilt.elf
: && ccache /usr/local/bin/clang --target=arm-none-eabi --specs=nosys.specs zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj -o zephyr/zephyr_prebuilt.elf -Wl,-T zephyr/linker.cmd -Wl,-Map=/home/lt/zephyrproject/zephyr/samples/subsys/power/device_pm/build/zephyr/zephyr_prebuilt.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/common/libarch__common.a zephyr/arch/arch/arm/core/libarch__arm__core.a zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a zephyr/arch/arch/arm/core/cortex_m/mpu/libarch__arm__core__cortex_m__mpu.a zephyr/lib/libc/minimal/liblib__libc__minimal.a zephyr/lib/posix/liblib__posix.a zephyr/soc/arm/nordic_nrf/nrf52/libsoc__arm__nordic_nrf__nrf52.a zephyr/boards/arm/reel_board/libboards__arm__reel_board.a zephyr/drivers/gpio/libdrivers__gpio.a zephyr/drivers/i2c/libdrivers__i2c.a zephyr/drivers/serial/libdrivers__serial.a modules/nordic/lib..__modules__hal__nordic.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj -L"/usr/lib/gcc/x86_64-linux-gnu/7.4.0" -L/home/lt/zephyrproject/zephyr/samples/subsys/power/device_pm/build/zephyr -lgcc -fshort-enums -mthumb -mcpu=cortex-m4 -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-section=alignment -u_OffsetAbsSyms -u_ConfigAbsSyms -nostdlib -static -no-pie -Wl,-X -Wl,-N -Wl,--orphan-handling=warn -mabi=aapcs -march=armv7e-m && :
clang-6.0: warning: argument unused during compilation: '--specs=nosys.specs' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-u _OffsetAbsSyms' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-u _ConfigAbsSyms' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
/usr/local/bin/ld.lld: error: zephyr/linker.cmd:189: { expected, but got ALIGN_WITH_INPUT
_bt_channels_area : ALIGN_WITH_INPUT SUBALIGN(4)
^
clang-6.0: error: ld.lld command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
ERROR: command exited with status 1: /usr/local/bin/cmake --build /home/lt/zephyrproject/zephyr/samples/subsys/power/device_pm/build


Is there any suggestion?
Thanks a lot!
_._,_._,_
llvm/clang isn’t supported for ARM SoCs.

- k


Errors generated when build a sample using clang6.0 #west

istuoli@...
 

Hello!
I want to build samples/subsys/power/device_pm using clang6.0 so I do as follows:
1、export ZEPHYR_TOOLCHAIN_VARIANT=llvm
2、mkdir build and cd build
3、cmake -DBOARD=reel_board ..
4、make
Then, I got some errors:

[ 95%] Linking C executable zephyr_prebuilt.elf
clang-6.0: warning: argument unused during compilation: '--specs=nosys.specs' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-u _OffsetAbsSyms' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-u _ConfigAbsSyms' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
/usr/local/bin/ld.lld: error: linker.cmd:189: { expected, but got ALIGN_WITH_INPUT
>>>  _bt_channels_area : ALIGN_WITH_INPUT SUBALIGN(4)
>>>                      ^
clang-6.0: error: ld.lld command failed with exit code 1 (use -v to see invocation)
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:101: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:557: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Then I turn to west and do:
west build -b reel_board ..
Some similar errors were generated:

[127/132] Linking C executable zephyr/zephyr_prebuilt.elf
FAILED: zephyr/zephyr_prebuilt.elf 
: && ccache /usr/local/bin/clang --target=arm-none-eabi   --specs=nosys.specs zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj  -o zephyr/zephyr_prebuilt.elf  -Wl,-T zephyr/linker.cmd -Wl,-Map=/home/lt/zephyrproject/zephyr/samples/subsys/power/device_pm/build/zephyr/zephyr_prebuilt.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/common/libarch__common.a zephyr/arch/arch/arm/core/libarch__arm__core.a zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a zephyr/arch/arch/arm/core/cortex_m/mpu/libarch__arm__core__cortex_m__mpu.a zephyr/lib/libc/minimal/liblib__libc__minimal.a zephyr/lib/posix/liblib__posix.a zephyr/soc/arm/nordic_nrf/nrf52/libsoc__arm__nordic_nrf__nrf52.a zephyr/boards/arm/reel_board/libboards__arm__reel_board.a zephyr/drivers/gpio/libdrivers__gpio.a zephyr/drivers/i2c/libdrivers__i2c.a zephyr/drivers/serial/libdrivers__serial.a modules/nordic/lib..__modules__hal__nordic.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj -L"/usr/lib/gcc/x86_64-linux-gnu/7.4.0" -L/home/lt/zephyrproject/zephyr/samples/subsys/power/device_pm/build/zephyr -lgcc -fshort-enums -mthumb -mcpu=cortex-m4 -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-section=alignment -u_OffsetAbsSyms -u_ConfigAbsSyms -nostdlib -static -no-pie -Wl,-X -Wl,-N -Wl,--orphan-handling=warn -mabi=aapcs -march=armv7e-m && :
clang-6.0: warning: argument unused during compilation: '--specs=nosys.specs' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-u _OffsetAbsSyms' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-u _ConfigAbsSyms' [-Wunused-command-line-argument]
clang-6.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
/usr/local/bin/ld.lld: error: zephyr/linker.cmd:189: { expected, but got ALIGN_WITH_INPUT
>>>  _bt_channels_area : ALIGN_WITH_INPUT SUBALIGN(4)
>>>                      ^
clang-6.0: error: ld.lld command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
ERROR: command exited with status 1: /usr/local/bin/cmake --build /home/lt/zephyrproject/zephyr/samples/subsys/power/device_pm/build


Is there any suggestion?
Thanks a lot!


Help with porting to the new GPIO API

Carles Cufi
 

Hi all,

As you might know there is a new GPIO API under development in the topic-gpio branch. All drivers should now be ported but the actual users of the GPIO API, which are spread all over the tree, need porting.

The following issue tracks progress with porting those users:

https://github.com/zephyrproject-rtos/zephyr/issues/20017

Our plan is to make the new GPIO API the default for Zephyr 2.2, but in order to achieve that we need to port all users of the API first.

* If you are already assigned to porting one or more users in the issue above, please consider submitting a PR against topic-gpio as early as you can
* If you know the code for any of the unassigned users, or want to learn more about the new GPIO API, feel free to assign yourself (send me an email and I will update the issue) and work on a PR

You can find useful tips for porting to the new API in this comment:

https://github.com/zephyrproject-rtos/zephyr/issues/20017#issuecomment-549315497

Feel free to reply to this email or join the #gpio channel on Slack if you have questions.

Thanks in advance!

Carles


Building MCUBoot with a DTS overlay file

Lawrence King
 

Hello:

 

I am not sure if this issue should be asked here, or in the MCUBoot mailing list, but I will start by asking here.

 

I want to change the partitions in my nrf52840, this is easy when building a zephyr system, I simply put an overlay file with my new partition table in the project directory, cmake finds it and uses it, and all is good. I tried the same thing when building mcuboot, it doesn’t work, although it looks like it should work.

 

I downloaded the latest mcuboot code from JuulLabs ‘git clone https://github.com/JuulLabs-OSS/mcuboot.git’.  And after running the appropriate mcuboot setup scripts I built mcuboot for zephyr.

In the project directory mcuboot/boot/zephyr I ran ‘west build -b nrf52840_mdk’, the build completes west flash is successful and the bootloader is running on the board as expected. Now I want to change the partition table (and of course the keys). I created a file nrf52840_mdk.overlay in the mcuboot/boot/zephyr directory (I also tried putting the overlay in the boards subdirectory):

 

&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>;

                };

                blob_partition: partition@f7000 {

                        label = "image-blob";

                        reg = <0x000f7000 0x00001000>;

                };

 

                /*

                 * 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 this is almost exactly the same as the standard partitions except the scratch partition is 4k smaller, and I have added a 4k blob partition.

When I compile this and attempt to flash the code, the code goes into the wrong partition, because the dts.overlay file is ignored.

 

The CMakelists.txt file  looks reasonable, it should overlay the dts.overlay AND the nrf52840_mdk.overlay when building the dts file, but it doesn’t actually end up with two overlays.

 

I tried numerous combinations of adding an overlay or two on the west command line, but I couldn’t get it to work.

west build -b nrf52840_mdk -- -DDTC_OVERLAY_FILE=”whatever”

 

I eventually added the contents of the dts.overlay file to my nrf52840_mdk.overlay, and I commented out part of the CMakeLists.txt file to make it work, but I don’t think this is the right way to do it:

 

# Add a common dts overlay necessary to ensure mcuboot is linked into,

# and fits inside, the boot partition. (If the user specified a

# DTC_OVERLAY_FILE on the CMake command line, we need to append onto

# the list).

#if(DTC_OVERLAY_FILE)

#  set(DTC_OVERLAY_FILE

#    "${DTC_OVERLAY_FILE} ${CMAKE_CURRENT_LIST_DIR}/dts.overlay"

#    CACHE STRING "" FORCE

#    )

#else()

#  set(DTC_OVERLAY_FILE ${CMAKE_CURRENT_LIST_DIR}/dts.overlay)

#endif()

 

if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}.overlay)

  set(DTC_OVERLAY_FILE

    "${DTC_OVERLAY_FILE} ${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}.overlay"

    CACHE STRING "" FORCE

    )

endif()

 

What is the right way to get two overlays into the mcuboot build?

 

 

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.

 

 

 


Daniel Fox <danny.fox97@...>
 

Hi All,
Im currently working on my 3rd year engineering project and I need some help/guidance as I'm a complete beginner. My project is a home monitoring system and my plan is to use PIR motion sensors inside the house, using Bluetooth mesh.

I have a few BBC Microbits and I have managed to implement the Mesh demo example from zephyr v1.14.
My plan is to try and replace the switch functions (button_pressed .. etc) to allow the motion sensor connected to GPIO PIN 0 on the BBC micro bit board. So when motion is detected it would act like how the button press function works on the boards.

My issue is I'm not sure how to program this and read the GPIO 0 pin, I want something like if motion sensor = 1 send messaged to light LED to other BBC micro bits. If motion sensor=0 do nothing.

From the microbit.c file:
#define BUZZER_PIN     EXT_P0_GPIO_PIN  // replace buzzer_pin with motion sensor ???

static void button_pressed(struct device *dev, struct gpio_callback *cb,
   u32_t pins)
{
struct mb_display *disp = mb_display_get();
 
if (pins & BIT(SW0_GPIO_PIN)) {
k_work_submit(&button_work);
} else {
u16_t target = board_set_target();
 
if (target > 0x0009) {
mb_display_print(disp, MB_DISPLAY_MODE_SINGLE,
 K_SECONDS(2), "A");
} else {
mb_display_print(disp, MB_DISPLAY_MODE_SINGLE,
 K_SECONDS(2), "%X", (target & 0xf));
}
}
}
 
... 

void board_play_tune(const char *str)
{
while (*str) {
u32_t period, duration = 0U;
 
while (*str && !isdigit((unsigned char)*str)) {
str++;
}
 
while (isdigit((unsigned char)*str)) {
duration *= 10U;
duration += *str - '0';
str++;
}
 
if (!*str) {
break;
}
 
if (str[1] == '#') {
period = get_period(*str, true);
str += 2;
} else {
period = get_period(*str, false);
str++;
}
 
if (period) {
pwm_pin_set_usec(pwm, BUZZER_PIN, period, period / 2U); 
}
 
k_sleep(duration);
 
/* Disable the PWM */
pwm_pin_set_usec(pwm, BUZZER_PIN, 0, 0);
}
}
.....

static void configure_button(void)
{
static struct gpio_callback button_cb;
 
k_work_init(&button_work, button_send_pressed);
 
gpio = device_get_binding(SW0_GPIO_CONTROLLER);

gpio_pin_configure(gpio, SW0_GPIO_PIN,
   (GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
    GPIO_INT_ACTIVE_LOW));
gpio_pin_configure(gpio, SW1_GPIO_PIN,
   (GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
    GPIO_INT_ACTIVE_LOW));
 
gpio_init_callback(&button_cb, button_pressed,
   BIT(SW0_GPIO_PIN) | BIT(SW1_GPIO_PIN));
gpio_add_callback(gpio, &button_cb);
 
gpio_pin_enable_callback(gpio, SW0_GPIO_PIN);
gpio_pin_enable_callback(gpio, SW1_GPIO_PIN);
}
 
I appreciate any help that you could give me. Thanks!


Re: MCP2515 with nRF52832 using zephyr #dts #nrf52832

Lawrence King
 

I think you need a few more things turned on in your config file. To figure out what you need turned on I always use the menuconfig tool and diff the old and new .config files, then I take the changes and pit them in my prj.conf file

 

In this case I ran ‘ninja menuconfig’ in the build directory, turned on SPI, then CANBUS, then MCP25625, here is a diff between zephyr/.config.old and zephyr/.config:

 

> CONFIG_SPI=y

678a679,695

> # CONFIG_SPI_ASYNC is not set

> # CONFIG_SPI_SLAVE is not set

> CONFIG_SPI_INIT_PRIORITY=70

> # CONFIG_SPI_LOG_LEVEL_OFF is not set

> # CONFIG_SPI_LOG_LEVEL_ERR is not set

> # CONFIG_SPI_LOG_LEVEL_WRN is not set

> CONFIG_SPI_LOG_LEVEL_INF=y

> # CONFIG_SPI_LOG_LEVEL_DBG is not set

> CONFIG_SPI_LOG_LEVEL=3

> # CONFIG_SPI_0 is not set

> # CONFIG_SPI_1 is not set

> # CONFIG_SPI_2 is not set

> # CONFIG_SPI_3 is not set

> # CONFIG_SPI_4 is not set

> # CONFIG_SPI_5 is not set

> # CONFIG_SPI_6 is not set

> CONFIG_SPI_NRFX=y

749a767,768

> # CONFIG_SPI_NOR is not set

> # CONFIG_SPI_FLASH_W25QXXDV is not set

760c779,797

< # CONFIG_CAN is not set

---

> CONFIG_CAN=y

> # CONFIG_CAN_LOG_LEVEL_OFF is not set

> # CONFIG_CAN_LOG_LEVEL_ERR is not set

> # CONFIG_CAN_LOG_LEVEL_WRN is not set

> CONFIG_CAN_LOG_LEVEL_INF=y

> # CONFIG_CAN_LOG_LEVEL_DBG is not set

> CONFIG_CAN_LOG_LEVEL=3

> CONFIG_CAN_INIT_PRIORITY=80

> CONFIG_CAN_WORKQ_FRAMES_BUF_CNT=4

> CONFIG_CAN_0=y

> CONFIG_CAN_1=y

> CONFIG_CAN_MCP2515=y

> CONFIG_CAN_MCP2515_OSC_FREQ=8000000

> CONFIG_CAN_MCP2515_INT_THREAD_STACK_SIZE=512

> CONFIG_CAN_MCP2515_INT_THREAD_PRIO=2

> CONFIG_CAN_MCP2515_MAX_FILTER=5

> CONFIG_CAN_MCP2515_INIT_PRIORITY=80

> # CONFIG_CAN_LOOPBACK is not set

> # CONFIG_CAN_NET is not set

 

My guess is you are not finding the SPI bus because you haven’t configured it.

 

Lawrence King

Principal Developer

+1(416)627-7302

 

From: users@... <users@...> On Behalf Of christophhintz@...
Sent: Tuesday, November 19, 2019 5:19 AM
To: users@...
Subject: [Zephyr-users] MCP2515 with nRF52832 using zephyr #dts #nrf52832

 

Hi I had a question to setup the MCP2515 driver in the zephyr project.

We made a custom board for the decawave DWM1001 module, which uses a nRF52832 chip. They have a device tree file in the zephyr project for this module, so I started with that device tree and configured it for our setup, which is

NRF52832

MCP25625

P0.14

SPI_CS

P0.22

SPI_MISO

P0.31

SPI_MOSI

P0.30

SPI_SCK

P0.27

CAN_RESET

P0.03

CAN_INT

. I attached the devicetree and project file to this post.
The main project file I am using is the can example from zephyr. I only added the pull up for the CAN_RESET GPIO, which I can confirm works. I am not seeing any messages on the SPI pins, which make me suspect that the overlay is incorrect. I just added the mcp into the spi setup in the overlay, from a shield example, I am not to sure if it is correct and what sjw, prop-seg, phase-seg1 and phase-seg2 mean. Any help or pointers are appreciated. The program stops with debug messages "CAN: Device driver not found.".


About PSE completeness

Claudio Scordino <c.scordino@...>
 

Dear all,

I'd like to know if there is already a schedule about reaching PSE51 or PSE52 completeness (as far as I've understood, only subsets of such standards are currently implemented).

Thanks.

         Claudio 


API meeting: agenda

Carles Cufi
 

Hi all,

This week we will look at:

- PWM: Add support for inverted PWM signals
- PR: https://github.com/zephyrproject-rtos/zephyr/pull/20657

- GPIO: Update on progress
- Look at the PRs with driver conversion (https://github.com/zephyrproject-rtos/zephyr/issues/18530)
- Check users of GPIO APIs: https://github.com/zephyrproject-rtos/zephyr/issues/20017
- Tips for converting users can be found here: https://github.com/zephyrproject-rtos/zephyr/issues/20017#issuecomment-549315497 (thanks Peter!)
- Any additional outstanding PRs to topic-gpio

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


MCP2515 with nRF52832 using zephyr #dts #nrf52832

christophhintz@...
 

Hi I had a question to setup the MCP2515 driver in the zephyr project.

We made a custom board for the decawave DWM1001 module, which uses a nRF52832 chip. They have a device tree file in the zephyr project for this module, so I started with that device tree and configured it for our setup, which is

NRF52832 MCP25625
P0.14 SPI_CS
P0.22 SPI_MISO
P0.31 SPI_MOSI
P0.30 SPI_SCK
P0.27 CAN_RESET
P0.03 CAN_INT

. I attached the devicetree and project file to this post.
The main project file I am using is the can example from zephyr. I only added the pull up for the CAN_RESET GPIO, which I can confirm works. I am not seeing any messages on the SPI pins, which make me suspect that the overlay is incorrect. I just added the mcp into the spi setup in the overlay, from a shield example, I am not to sure if it is correct and what sjw, prop-seg, phase-seg1 and phase-seg2 mean. Any help or pointers are appreciated. The program stops with debug messages "CAN: Device driver not found.".



Re: #stm32 pinmux.c compile failure STM32F407 #stm32

Erwan Gouriou
 

Hi Neo

I'd advise you to have a look to STM32 clock control driver.
It provides MCO support. It might not provide exactly the requested configuration, but at least it would be a working point that you can custom to your own need.

Erwan


On Fri, 8 Nov 2019 at 18:28, <nanjunneo@...> wrote:
Hello guys,

for the board STM32F407 I want to add pin PA8 25 MHz clk output to Etherent Phy. So that I add the following sentence (1)
 
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_1)          into the pinmux.c.
 
The rest of code in pinmux.c I copied from stm32f4_dico, except I configure OTG_HS_DM / OTG_HS_DP as virtual port.
 
The compiling fails at the last step:  `HAL_GPIO_Init' is not defined.
[129/134] Linking C executable zephyr/zephyr_prebuilt.elf
FAILED: zephyr/zephyr_prebuilt.elf
.....
.....
/home/neo/ARM-GCC-Toolchain/gcc-arm-none-eabi-8-2019-q3-update-linux/gcc-arm-none-eabi-8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: modules/stm32/stm32cube/lib..__modules__hal__stm32__stm32cube.a(stm32f4xx_hal_rcc.c.obj): in function `HAL_RCC_MCOConfig':
/home/neo/zephyr_2_0_99/zephyrproject/modules/hal/stm32/stm32cube/stm32f4xx/drivers/src/stm32f4xx_hal_rcc.c:769: undefined reference to `HAL_GPIO_Init'
/home/neo/ARM-GCC-Toolchain/gcc-arm-none-eabi-8-2019-q3-update-linux/gcc-arm-none-eabi-8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /home/neo/zephyr_2_0_99/zephyrproject/modules/hal/stm32/stm32cube/stm32f4xx/drivers/src/stm32f4xx_hal_rcc.c:793: undefined reference to `HAL_GPIO_Init'
collect2: error: ld returned 1 exit status
 
The pinmux.c is attaced here. the compile is successful without adding the sentence(1).
 
Do you have any idea? or how can I check it further?
Thank you!
------------------------------------------------------pinmux.c in board file-----------------------------------------------------------------
#include <kernel.h>
#include <device.h>
#include <init.h>
#include <drivers/pinmux.h>
#include <sys/sys_io.h>

#include "stm32f4xx.h"
#include <pinmux/stm32/pinmux_stm32.h>

/* pin assignments for STM32F4DISCOVERY board */
static const struct pin_config pinconf[] = {
 
#ifdef CONFIG_UART_1
{STM32_PIN_PB6, STM32F4_PINMUX_FUNC_PB6_USART1_TX},
{STM32_PIN_PB7, STM32F4_PINMUX_FUNC_PB7_USART1_RX},
#endif /* CONFIG_UART_1 */
 
#ifdef CONFIG_UART_2
{STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX},
#endif /* CONFIG_UART_2 */
 
#ifdef CONFIG_PWM_STM32_2
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */
 
#ifdef CONFIG_USB_DC_STM32
    { STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_OTG_HS_DM },
    { STM32_PIN_PB15, STM32F4_PINMUX_FUNC_PB15_OTG_HS_DP },
#endif  /* CONFIG_USB_DC_STM32 */
};

static int pinmux_stm32_init(struct device *port)
{
ARG_UNUSED(port);

HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_1); ----------------------------------------------------------------------(1)

stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf));

return 0;
}

SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1,
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);

Best regards,
Neo


Tomorrow's API meeting: Agenda

Carles Cufi
 

Hi all,

This week we will look at:

- QSPI/jedec API proposal vs SPI API extension:
- https://github.com/zephyrproject-rtos/zephyr/pull/20069
vs
- https://github.com/zephyrproject-rtos/zephyr/pull/20564

- GPIO: Update on progress
- Look at the PRs with driver conversion (https://github.com/zephyrproject-rtos/zephyr/issues/18530)
- Check users of GPIO APIs: https://github.com/zephyrproject-rtos/zephyr/issues/20017
- Tips for converting users can be found here: https://github.com/zephyrproject-rtos/zephyr/issues/20017#issuecomment-549315497 (thanks Peter!)
- Any additional outstanding PRs to topic-gpio

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


#stm32 pinmux.c compile failure STM32F407 #stm32

nanjunneo@...
 

Hello guys,

for the board STM32F407 I want to add pin PA8 25 MHz clk output to Etherent Phy. So that I add the following sentence (1)
 
HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_1)          into the pinmux.c.
 
The rest of code in pinmux.c I copied from stm32f4_dico, except I configure OTG_HS_DM / OTG_HS_DP as virtual port.
 
The compiling fails at the last step:  `HAL_GPIO_Init' is not defined.
[129/134] Linking C executable zephyr/zephyr_prebuilt.elf
FAILED: zephyr/zephyr_prebuilt.elf
.....
.....
/home/neo/ARM-GCC-Toolchain/gcc-arm-none-eabi-8-2019-q3-update-linux/gcc-arm-none-eabi-8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: modules/stm32/stm32cube/lib..__modules__hal__stm32__stm32cube.a(stm32f4xx_hal_rcc.c.obj): in function `HAL_RCC_MCOConfig':
/home/neo/zephyr_2_0_99/zephyrproject/modules/hal/stm32/stm32cube/stm32f4xx/drivers/src/stm32f4xx_hal_rcc.c:769: undefined reference to `HAL_GPIO_Init'
/home/neo/ARM-GCC-Toolchain/gcc-arm-none-eabi-8-2019-q3-update-linux/gcc-arm-none-eabi-8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /home/neo/zephyr_2_0_99/zephyrproject/modules/hal/stm32/stm32cube/stm32f4xx/drivers/src/stm32f4xx_hal_rcc.c:793: undefined reference to `HAL_GPIO_Init'
collect2: error: ld returned 1 exit status
 
The pinmux.c is attaced here. the compile is successful without adding the sentence(1).
 
Do you have any idea? or how can I check it further?
Thank you!
------------------------------------------------------pinmux.c in board file-----------------------------------------------------------------
#include <kernel.h>
#include <device.h>
#include <init.h>
#include <drivers/pinmux.h>
#include <sys/sys_io.h>

#include "stm32f4xx.h"
#include <pinmux/stm32/pinmux_stm32.h>

/* pin assignments for STM32F4DISCOVERY board */
static const struct pin_config pinconf[] = {
 
#ifdef CONFIG_UART_1
{STM32_PIN_PB6, STM32F4_PINMUX_FUNC_PB6_USART1_TX},
{STM32_PIN_PB7, STM32F4_PINMUX_FUNC_PB7_USART1_RX},
#endif /* CONFIG_UART_1 */
 
#ifdef CONFIG_UART_2
{STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_USART2_RX},
#endif /* CONFIG_UART_2 */
 
#ifdef CONFIG_PWM_STM32_2
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */
 
#ifdef CONFIG_USB_DC_STM32
    { STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_OTG_HS_DM },
    { STM32_PIN_PB15, STM32F4_PINMUX_FUNC_PB15_OTG_HS_DP },
#endif  /* CONFIG_USB_DC_STM32 */
};

static int pinmux_stm32_init(struct device *port)
{
ARG_UNUSED(port);

HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_HSE, RCC_MCODIV_1); ----------------------------------------------------------------------(1)

stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf));

return 0;
}

SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1,
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);

Best regards,
Neo