Date   

Help using SystemView on an STM32 Nucleo board with re-flashed ST-Link #jlink #stm32

carlos.rodriguez@...
 

Hello:
 
I was wondering if the community could help me with using SystemView with Zephyr. 
 
When I connect to the board using JLink and then try to record with Systemview, I get a message telling me that the RTT control block was not detected.  If I force the call to SEGGER_SYSVIEW_Start() by either setting CONFIG_SEGGER_SYSTEMVIEW_BOOT_ENABLE=y or by putting it in my main function, what I get instead is a message to the effect that it can't find the SystemView buffer.
 
I believe I've been following the instructions correctly as outlined here:
 
https://docs.zephyrproject.org/2.4.0/guides/debugging/probes.html?highlight=segger.
 
and here
 
https://docs.zephyrproject.org/1.9.0/samples/subsys/debug/sysview/README.html
 
I am using Zephyr 2.4.9 with the 0.11.4 SDK on Ubuntu 20.4.
 
For the image, I am using the hello_world example and adding the following to the prj.conf file:
 
CONFIG_TRACING=y
CONFIG_SEGGER_SYSTEMVIEW=y
CONFIG_THREAD_NAME=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_SEGGER_SYSTEMVIEW_BOOT_ENABLE=y
CONFIG_STDOUT_CONSOLE=y
 
It's interesting to note that JLink itself appears to connect just fine:
 
Connecting to target via SWD
Found SW-DP with ID 0x4BA01477
STM32 (Protection Detection): Unexpected IDCODE DEV_ID 0x 461 found. Only checking the 1st flash bank for write protection.
Found SW-DP with ID 0x4BA01477
DPv0 detected
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
Cortex-M4 identified.
J-Link>
 
I am working on a Nucleo-L496ZG board, but the same thing happens on a Nucleo-F429Zi or a Nucleo-L4R5zi.  I am following the SEGGER instructions to flash the onboard ST-Links with JLink firmware, which appears to work fine.
 
Any help will be appreciated.
 
Best regards:
 
-Carlos Rodriguez.


Re: custom board #customboard #dts

Bolivar, Marti
 

Hi there,

The error message may have gotten lost in the rest of the output, but it
describes what went wrong, a stack trace where it went wrong, and how to
fix it:

"wbasser via lists.zephyrproject.org"
<wbasser=gmail.com@lists.zephyrproject.org> writes:

CMake Error at C:/zephyrproject/zephyr/boards/common/openocd-nrf5.board.cmake:13 (message):
Can't match nrf5 subfamily from BOARD name.  To fix, set CMake variable
OPENOCD_NRF5_SUBFAMILY.
Call Stack (most recent call first):
boards/arm/fuseboard/board.cmake:8 (include)
C:/zephyrproject/zephyr/cmake/app/boilerplate.cmake:622 (include)
C:/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
C:/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
CMakeLists.txt:10 (find_package)
Did you try setting the variable mentioned in the error in your
board.cmake before including openocd-nrf5.board.cmake?


Re: custom board #customboard #dts

Lawrence King
 

The Kconfig.defconfig doesn’t look right

 

config BOARD

              default "fuse board"

 

I think it should be “fuseboard” or maybe “fuse_board” but I didn’t test it. I looked at every other board name in the zephyr tree and none have a space in the default.

 

Lawrence King

Principal Developer

+1(416)627-7302

 

From: users@... <users@...> On Behalf Of wbasser@...
Sent: Wednesday, March 31, 2021 1:21 PM
To: users@...
Subject: [Zephyr-users] custom board #customboard #dts

 

Created a custom board file, based on the DTS for a sample board.  Changed the name of the file, and the references to the new board.  Attempting to build, I received this error.

C:\zephyrproject\zephyr>west build -p auto -b fuseboard c:/temp/fusetest

-- west build: making build dir C:\zephyrproject\zephyr\build pristine

-- west build: generating a build system

Including boilerplate (Zephyr base): C:/zephyrproject/zephyr/cmake/app/boilerplate.cmake

-- Application: C:/Temp/FuseTest

-- Zephyr version: 2.5.99 (C:/zephyrproject/zephyr)

-- Found Python3: C:/Python39/python.exe (found suitable exact version "3.9.2") found components: Interpreter

-- Found west (found suitable version "0.9.0", minimum required is "0.7.1")

-- Board: fuseboard

-- Cache files will be written to: C:/zephyrproject/zephyr/.cache

-- Found toolchain: gnuarmemb (c:/gnuarmemb)

-- Found BOARD.dts: C:/Temp/FuseTest/boards/arm/fuseboard/fuseboard.dts

-- Generated zephyr.dts: C:/zephyrproject/zephyr/build/zephyr/zephyr.dts

-- Generated devicetree_unfixed.h: C:/zephyrproject/zephyr/build/zephyr/include/generated/devicetree_unfixed.h

-- Generated device_extern.h: C:/zephyrproject/zephyr/build/zephyr/include/generated/device_extern.h

Parsing C:/zephyrproject/zephyr/Kconfig

Loaded configuration 'C:/Temp/FuseTest/boards/arm/fuseboard/fuseboard_defconfig'

Merged configuration 'C:/Temp/FuseTest/prj.conf'

Configuration saved to 'C:/zephyrproject/zephyr/build/zephyr/.config'

Kconfig header saved to 'C:/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h'

-- The C compiler identification is GNU 10.2.1

-- The CXX compiler identification is GNU 10.2.1

-- The ASM compiler identification is GNU

-- Found assembler: C:/gnuarmemb/bin/arm-none-eabi-gcc.exe

CMake Error at C:/zephyrproject/zephyr/boards/common/openocd-nrf5.board.cmake:13 (message):

  Can't match nrf5 subfamily from BOARD name.  To fix, set CMake variable

  OPENOCD_NRF5_SUBFAMILY.

Call Stack (most recent call first):

  boards/arm/fuseboard/board.cmake:8 (include)

  C:/zephyrproject/zephyr/cmake/app/boilerplate.cmake:622 (include)

  C:/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)

  C:/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)

  CMakeLists.txt:10 (find_package)

 

 

-- Configuring incomplete, errors occurred!

See also "C:/zephyrproject/zephyr/build/CMakeFiles/CMakeOutput.log".

See also "C:/zephyrproject/zephyr/build/CMakeFiles/CMakeError.log".

FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' '-DWEST_PYTHON=c:\python39\python.exe' '-BC:\zephyrproject\zephyr\build' '-Sc:\temp\fusetest' -GNinja -DBOARD=fuseboard

I have had a successful attempt at this with a different family of processors with no problem.  

I have attached the project files for reference.

Any help would be appreciated.


custom board #customboard #dts

wbasser@...
 

Created a custom board file, based on the DTS for a sample board.  Changed the name of the file, and the references to the new board.  Attempting to build, I received this error.
C:\zephyrproject\zephyr>west build -p auto -b fuseboard c:/temp/fusetest
-- west build: making build dir C:\zephyrproject\zephyr\build pristine
-- west build: generating a build system
Including boilerplate (Zephyr base): C:/zephyrproject/zephyr/cmake/app/boilerplate.cmake
-- Application: C:/Temp/FuseTest
-- Zephyr version: 2.5.99 (C:/zephyrproject/zephyr)
-- Found Python3: C:/Python39/python.exe (found suitable exact version "3.9.2") found components: Interpreter
-- Found west (found suitable version "0.9.0", minimum required is "0.7.1")
-- Board: fuseboard
-- Cache files will be written to: C:/zephyrproject/zephyr/.cache
-- Found toolchain: gnuarmemb (c:/gnuarmemb)
-- Found BOARD.dts: C:/Temp/FuseTest/boards/arm/fuseboard/fuseboard.dts
-- Generated zephyr.dts: C:/zephyrproject/zephyr/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/zephyrproject/zephyr/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: C:/zephyrproject/zephyr/build/zephyr/include/generated/device_extern.h
Parsing C:/zephyrproject/zephyr/Kconfig
Loaded configuration 'C:/Temp/FuseTest/boards/arm/fuseboard/fuseboard_defconfig'
Merged configuration 'C:/Temp/FuseTest/prj.conf'
Configuration saved to 'C:/zephyrproject/zephyr/build/zephyr/.config'
Kconfig header saved to 'C:/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/gnuarmemb/bin/arm-none-eabi-gcc.exe
CMake Error at C:/zephyrproject/zephyr/boards/common/openocd-nrf5.board.cmake:13 (message):
  Can't match nrf5 subfamily from BOARD name.  To fix, set CMake variable
  OPENOCD_NRF5_SUBFAMILY.
Call Stack (most recent call first):
  boards/arm/fuseboard/board.cmake:8 (include)
  C:/zephyrproject/zephyr/cmake/app/boilerplate.cmake:622 (include)
  C:/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  C:/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  CMakeLists.txt:10 (find_package)
 
 
-- Configuring incomplete, errors occurred!
See also "C:/zephyrproject/zephyr/build/CMakeFiles/CMakeOutput.log".
See also "C:/zephyrproject/zephyr/build/CMakeFiles/CMakeError.log".
FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' '-DWEST_PYTHON=c:\python39\python.exe' '-BC:\zephyrproject\zephyr\build' '-Sc:\temp\fusetest' -GNinja -DBOARD=fuseboard

I have had a successful attempt at this with a different family of processors with no problem.  

I have attached the project files for reference.

Any help would be appreciated.



Advertising/Scan ISO ticker nodes #ble

Carl Stehle
 

Hello,

When using CONFIG_BT_CTLR_ADV_ISO or CONFIG_BT_CTLR_SYNC_ISO, is it necessary to define ticker nodes in subsys/bluetooth/controller/ll_sw/ull.c:

#if defined(CONFIG_BT_CTLR_ADV_ISO)
#define BT_ADV_ISO_TICKER_NODES ((TICKER_ID_ADV_ISO_LAST) - \
                 (TICKER_ID_ADV_ISO_BASE) + 1)
#else
#define BT_ADV_ISO_TICKER_NODES 0
#endif

#if defined(CONFIG_BT_CTLR_SYNC_ISO)
#define BT_SCAN_SYNC_ISO_TICKER_NODES ((TICKER_ID_SCAN_SYNC_ISO_LAST) - \
                   (TICKER_ID_SCAN_SYNC_ISO_BASE) + 1)
#else
#define BT_SCAN_SYNC_ISO_TICKER_NODES 0
#endif

and add them to the definition:

#define TICKER_NODES              (TICKER_ID_ULL_BASE + \
                   BT_ADV_TICKER_NODES + \
                   BT_ADV_AUX_TICKER_NODES + \
                   BT_ADV_SYNC_TICKER_NODES + \
                   BT_ADV_ISO_TICKER_NODES + \
                   BT_SCAN_TICKER_NODES + \
                   BT_SCAN_AUX_TICKER_NODES + \
                   BT_SCAN_SYNC_TICKER_NODES + \
                   BT_SCAN_SYNC_ISO_TICKER_NODES + \
                   BT_CONN_TICKER_NODES + \
                   BT_CIG_TICKER_NODES + \
                   USER_TICKER_NODES + \
                   FLASH_TICKER_NODES)

Thank you,
Carl


Re: UART API Blocking TX

Tavish Naruka
 

Hi Jieng,

The uart_poll_out() API should be used for this, see https://docs.zephyrproject.org/latest/reference/peripherals/uart.html#c.uart_poll_out

Best,

Tavish


Re: Using SPI Port Question - Fanstel BT840

Jeremy Herbert
 

Hi Mike,

I am not an expert on Zephyr, in fact I am roughly in the same position as you. But I have recently solved this problem so I thought I should share. I apologise in advance if some of this is obvious to you already.

The ADXL372 example will not be useful to you, because Zephyr already has a driver for that specific device. This abstracts away the direct bus access.

The first thing you need to do is ensure that the SPI peripheral is mapped to the correct pins. You can do this in the dts file for the board, or using a dts overlay. Something like this is what I would normally use for the nrf52840:

&spi1 {
    compatible = "nordic,nrf-spi";
    status = "okay";
    sck-pin = <14>;
    mosi-pin = <13>;
    miso-pin = <15>;
    cs-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
    clock-frequency = <1000000>;
};


There is no driver for this FRAM device, so the example does indeed use the bare API to control the SPI bus.

The main use of the raw SPI API is in the function mb85rs64v_access. Note that the Zephyr APIs use a structure-in-structure approach, where you pass a spi_buf_set which contains one or more spi_buf. If you cross-reference that code with the documentation here: https://docs.zephyrproject.org/latest/reference/peripherals/spi.html it should make more sense.

Hope this helps.

Thanks,
Jeremy


Using SPI Port Question - Fanstel BT840

Mike Marks
 

 

Greetings,

 

I wonder if this is the correct place to seek help with a problem I am seeing.  I am trying to use the SPI port on a Fanstel BT840, and was hoping to use the spi_read() and spi_write() functions that are found in the header file spi.h in the directory zephyr/include/drivers/. These functions would be used to pass data between the Bluetooth and SPI ports on the Fanstel BT840. The Fanstel part has the Nordic nRF82540 as its core processor.

 

In my project’s main.c, I include <drivers/spi.h>.  I am then able to add ‘status = spi_read(spiDev, &spiConfig, &spi_rx);’, but run into exception errors when I try to step over this function. A Nordic FAE suggested that I might be taking a wrong approach, and should instead seek out examples that make use of the SPI port. Looking through the adxl372 example he suggested, it is not obvious how to read and write from the SPI port.

 

Zephyr is a new and very broad field to me, so I would appreciate any pointers to get going in the right direction.

 

Thanks,

 

Mike Marks

Utility Relay Company.

 

 


UART API Blocking TX

jleng
 
Edited

Hi,

I'm using Zephyr's UART API and especially the uart_tx() function. However, the function being non-blocking is giving me troubles. Does any one know how to make it blocking or any method to make sure uart_tx() is done sending before the program proceeds?

Thank you,
jleng


Analog Microphone sensortile box

Dimitrios Kosyvas <kosyvas14828@...>
 

Hello

I am trying to get some samples from the MP23ABS1 (analog sound sensor) in the STM32L4R9ZI chip . I am using the ADC zephyr driver to try and interact with the microphone but i am not reading anything .Is there any working example on how to use the adc zephyr driver on a stm32 board ?


Dimitris Kosyvas


Flash Circular Buffer on external spi flash

antoker@...
 

Hello

Is it possible to use FCB on external spi flash? I see that FCB functions do not really contain any references to a flash device so I'm not sure if it can only be used against internal flash?

-a


Re: Porting a board - running twister #nrf5 #test #nrf52 #nrf53

Kumar Gala
 

On Mar 25, 2021, at 6:15 PM, Bob Recny <bob@kittycentral.us> wrote:

Greetings,

I'm preparing some PRs to add our u-blox nRF52 and nRF53 EVK boards to Zephyr. I'd like to run twister locally and seem to have things working. I'm running out of drive space due to the size of the twister output.
What's the best way to either limit what gets tested (i.e. don't need other than nRF5x), or what size drive should I allocate to my VM?

Thanks,
Bob Recny
brec-u-blox
How are you invoking twister? You can do the following for new boards:

./scripts/twister -p <NEW BOARD NAME>

That will limit twister to just build tests for the new board you are adding.

You can also add `-M` to help reduce disk usage

- k


Porting a board - running twister #nrf5 #test #nrf52 #nrf53

Bob Recny <bob@...>
 

Greetings,

I'm preparing some PRs to add our u-blox nRF52 and nRF53 EVK boards to Zephyr. I'd like to run twister locally and seem to have things working. I'm running out of drive space due to the size of the twister output.
What's the best way to either limit what gets tested (i.e. don't need other than nRF5x), or what size drive should I allocate to my VM?

Thanks,
Bob Recny
brec-u-blox


Re: Compiling windbond spi flash driver

Bolivar, Marti
 

Hi Raz,

I'm curious what version of Zephyr you're running. Since your error
message mentions devicetree_fixups.h, it seems it might be on the older
side.

The DT "fixups" feature was deprecated in Zephyr 2.3 when the current
devicetree.h API was first introduced. If you're using that version or
later, you should probably move away from using fixup files.

The build system will warn you about this deprecation if it discovers
any DTS fixup files.

For documentation on the jedec,spi-nor compatible in Kumar's example as
it is used in the current Zephyr tree, see its page in the bindings index:

https://docs.zephyrproject.org/latest/reference/devicetree/bindings/jedec%2Cspi-nor-spi.html#jedec-spi-nor-spi

If you're using fixup files because you are on Zephyr v1.14 LTS, you
will need to check the binding YAML file in
dts/bindings/mtd/jedec,spi-nor.yaml directly, as the generated bindings
index pages are not available in the LTS docs:

https://github.com/zephyrproject-rtos/zephyr/blob/v1.14.2/dts/bindings/mtd/jedec%2Cspi-nor.yaml

Note the LTS YAML bindings syntax is different than what you'll see v2.x
bindings.

"Kumar Gala via lists.zephyrproject.org"
<kumar.gala=linaro.org@lists.zephyrproject.org> writes:

Here’s an example:

https://github.com/zephyrproject-rtos/zephyr/blob/63ca48a7a9b8e9a85d9c18c5dbaf894968bbc35d/boards/arm/black_f407ve/black_f407ve.dts#L101

- k

On Mar 24, 2021, at 11:27 AM, Raz <raziebe@gmail.com> wrote:

how do i describe winbond in the device tree ? i have the spi addresses but what about the flash ? is there an example ?

On Wed, Mar 24, 2021 at 5:56 PM Kumar Gala <kumar.gala@linaro.org> wrote:
Is the device described in the devicetree for the board you are building for?

- k

On Mar 24, 2021, at 10:52 AM, Raz <raziebe@gmail.com> wrote:

Hello
I am fail to compile winbond spi flash driver (SPI_FLASH_W25QXXD)I fail to compile:
I get errors like :
zephyr/include/generated/devicetree_fixups.h:205:32: error: 'DT_ST_STM32_SPI_FIFO_40003C00_BASE_ADDRESS' undeclared here (not in a f

Am I missing a step ?

Kind regards
Raz







Re: Message Queues

Olga Syrbachova <syrba4eva28@...>
 

I have found msgdev.c under samples/scheduler/kernel/metairq_dispatch/src. And according to this example I'm quite sure my code is right. I have updated it here https://github.com/syrba4eva/Zephyr-RTOS/blob/main/main.c

But I still have some errors when I try

ol@ol-H270M-DS3H:~/zephyrproject/zephyr$ west build -b qemu_x86 samples/synchronization --pristine
...
expected declaration specifiers or '...' before '&' token
   40 | k_msgq_init(&my_msgq, my_msgq_buffer, sizeof(struct data_item_type), 10);
      |             ^
/home/ol/zephyrproject/zephyr/samples/synchronization/src/main.c:40:23: error: expected declaration specifiers or '...' before 'my_msgq_buffer'
   40 | k_msgq_init(&my_msgq, my_msgq_buffer, sizeof(struct data_item_type), 10);
      |                       ^~~~~~~~~~~~~~
/home/ol/zephyrproject/zephyr/samples/synchronization/src/main.c:40:39: error: expected declaration specifiers or '...' before 'sizeof'
   40 | k_msgq_init(&my_msgq, my_msgq_buffer, sizeof(struct data_item_type), 10);
      |                                       ^~~~~~
/home/ol/zephyrproject/zephyr/samples/synchronization/src/main.c:40:70: error: expected declaration specifiers or '...' before numeric constant
   40 | k_msgq_init(&my_msgq, my_msgq_buffer, sizeof(struct data_item_type), 10);
      |                                                                      ^~
/home/ol/zephyrproject/zephyr/samples/synchronization/src/main.c: In function 'threadA':
/home/ol/zephyrproject/zephyr/samples/synchronization/src/main.c:62:21: error: storage size of 'data' isn't known
   62 |  struct data_item_t data;
      |                     ^~~~
/home/ol/zephyrproject/zephyr/samples/synchronization/src/main.c:62:21: warning: unused variable 'data' [-Wunused-variable]
[54/118] Building C object zephyr/arch.../arch__x86__core.dir/ia32/thread.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/ol/zephyrproject/zephyr/build

And I still have this question: is it the right way to build my own application by modifying a "synchronization" sample? I'm doing it right under $HOME/zephyrproject/zephyr/samples/synchronization/src. Or should I create a new file in another directory?


On Thu, 25 Mar 2021 at 19:45, Olga Syrbachova <syrba4eva28@...> wrote:
Thank you very much for your reply! Unfortunately I can't find samples/scheduler/metairq_dispatch neither on the website of zephyrproject nor on  GIT. Could you please tell me where I can find  msgdev.c?

And also I would like to know if it's the right way to build my own application by modifying a "synchronization" sample? I'm doing it right under $HOME/zephyrproject/zephyr/samples/synchronization/src. Or should I create a new file in another directory?

Many thanks in advance!

On Thu, 25 Mar 2021 at 07:52, Kim Boendergaard <kim.boendergaard@...> wrote:

Consider having a look at msgdev.c in samples/scheduler/metairq_dispatch

 

I think that clearly answer your questions

 

Best regards,

Kim Bøndergaard | Software Tech Lead, Esco Medical
Phone: +45 51 54 39 61

 

From: users@... <users@...> On Behalf Of Olga Syrbachova
Sent: Wednesday, 24 March 2021 15.29
To: users@...
Subject: [Zephyr-users] Message Queues

 

EXTERNAL — Use caution when opening link(s) or attachment(s)


Hi! I'm trying to create my own app. I decided to start by modifying a "synchronization" sample. In my app I want to have 2 threads and 1 queue, so one thread can send messages to this queue and another thread is reading messages from the queue. I didn't find any sample with queues and I'm not sure how exactly to make queues. And I don't understand what I should put in "data" here:

 

void producer_thread(void)
{
    struct data_item_type data;
 
    while (1) {
        /* create data item to send (e.g. measurement, timestamp, ...) */
        data = ...
 
        /* send data to consumers */
        while (k_msgq_put(&my_msgq, &data, K_NO_WAIT) != 0) {
            /* message queue is full: purge old data & try again */
            k_msgq_purge(&my_msgq);
        }
 
        /* data item was successfully added to message queue */
    }
}

Data is of type struct data_item_type and it has 3 items in the example on the website. Does it mean I have to initialize my data in this way for example:

data.field1 = 2; /* int = 2 */

data.field2 = 3; /* int = 3 */

 

I followed the tutorial on the website, but not all steps are clear to me. You can find my code on github: https://github.com/syrba4eva/Zephyr-RTOS/blob/main/main.c

 

Can you please suggest any sample with queues or tell me what I am doing wrong? Many thanks in advance.



[The information contained in this email (including any attachments) is confidential and is intended solely for the use of the named addressee. Any unauthorized use, disclosure, reproduction, copying, distribution, or other form of unauthorized dissemination of the contents is expressly prohibited. If you have received this communication in error, please notify the sender immediately by email and delete the original message. Opinions, conclusions and other information in this message represent the opinion of the sender and do not necessarily represent or reflect the views and opinions of Esco Group companies.]



Re: Error by building own app

Bolivar, Marti
 

Hello,

Please refer to this troubleshooting item:

https://docs.zephyrproject.org/latest/guides/west/troubleshooting.html#invalid-choice-build-or-flash-etc

"Olga Syrbachova via lists.zephyrproject.org"
<syrba4eva28=gmail.com@lists.zephyrproject.org> writes:

Hi! I want to create my own app. So I've followed the instructions given on
the website https://docs.zephyrproject.org/latest/application/index.html.
For the beginning I just copied the src/main.c, CMakeLists.txt (here I
changed the project name to "my_app") and orj.conf from
zephyrproject/zephyr/samples/hello_world to Home/app. Next I ran

west build -b qemu_x86

and got an error:

ol@ol-H270M-DS3H:~$ west build -b qemu_x86 ~/app
usage: west [-h] [-z ZEPHYR_BASE] [-v] [-V] <command> ...
west: error: argument <command>: invalid choice: 'build' (choose from
'init', 'update', 'list', 'manifest', 'diff', 'status', 'forall',
'help', 'config', 'topdir', 'selfupdate')

I also tried to run this command with --pristine, but it didn't work.
What am I doing wrong? Any help would be highly appreciated. Thank you
in advance.



Re: Message Queues

Olga Syrbachova <syrba4eva28@...>
 

Thank you very much for your reply! Unfortunately I can't find samples/scheduler/metairq_dispatch neither on the website of zephyrproject nor on  GIT. Could you please tell me where I can find  msgdev.c?

And also I would like to know if it's the right way to build my own application by modifying a "synchronization" sample? I'm doing it right under $HOME/zephyrproject/zephyr/samples/synchronization/src. Or should I create a new file in another directory?

Many thanks in advance!


On Thu, 25 Mar 2021 at 07:52, Kim Boendergaard <kim.boendergaard@...> wrote:

Consider having a look at msgdev.c in samples/scheduler/metairq_dispatch

 

I think that clearly answer your questions

 

Best regards,

Kim Bøndergaard | Software Tech Lead, Esco Medical
Phone: +45 51 54 39 61

 

From: users@... <users@...> On Behalf Of Olga Syrbachova
Sent: Wednesday, 24 March 2021 15.29
To: users@...
Subject: [Zephyr-users] Message Queues

 

EXTERNAL — Use caution when opening link(s) or attachment(s)


Hi! I'm trying to create my own app. I decided to start by modifying a "synchronization" sample. In my app I want to have 2 threads and 1 queue, so one thread can send messages to this queue and another thread is reading messages from the queue. I didn't find any sample with queues and I'm not sure how exactly to make queues. And I don't understand what I should put in "data" here:

 

void producer_thread(void)
{
    struct data_item_type data;
 
    while (1) {
        /* create data item to send (e.g. measurement, timestamp, ...) */
        data = ...
 
        /* send data to consumers */
        while (k_msgq_put(&my_msgq, &data, K_NO_WAIT) != 0) {
            /* message queue is full: purge old data & try again */
            k_msgq_purge(&my_msgq);
        }
 
        /* data item was successfully added to message queue */
    }
}

Data is of type struct data_item_type and it has 3 items in the example on the website. Does it mean I have to initialize my data in this way for example:

data.field1 = 2; /* int = 2 */

data.field2 = 3; /* int = 3 */

 

I followed the tutorial on the website, but not all steps are clear to me. You can find my code on github: https://github.com/syrba4eva/Zephyr-RTOS/blob/main/main.c

 

Can you please suggest any sample with queues or tell me what I am doing wrong? Many thanks in advance.



[The information contained in this email (including any attachments) is confidential and is intended solely for the use of the named addressee. Any unauthorized use, disclosure, reproduction, copying, distribution, or other form of unauthorized dissemination of the contents is expressly prohibited. If you have received this communication in error, please notify the sender immediately by email and delete the original message. Opinions, conclusions and other information in this message represent the opinion of the sender and do not necessarily represent or reflect the views and opinions of Esco Group companies.]



Re: DeviceTree binding problem #dts #customboard

Kumar Gala
 

On Mar 25, 2021, at 10:57 AM, wbasser@gmail.com wrote:

I created some local GPIO pins in a custom device tree for the project. It build correctly and I can see the entries in both the "build/zephyr.dts" and "build/includes/generated/devicetree_unfixed.h".
A snippet below shows the entries in the DTS file for the board
/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
pwm-led0 = &pwm_led0;
sw0 = &user_button;
i2c-0 = &sercom2;
test1 = &test1;
test2 = &test2;
};

outputs {
compatible = "gpio";
test1: test1_0 {
gpios = <&porta 16 0>;
label = "TEST1";
};
test2: test2_0 {
gpios = <&porta 17 0>;
label = "TEST2";
};
};



In main:
#include <zephyr.h>
#include <sys/printk.h>
#include <devicetree.h>
#include <drivers/gpio.h>

#define TEST1_ALIAS DT_ALIAS( test1 )

void main(void)
{
uint32_t uPin;

uPin = DT_GPIO_PIN( TEST1_ALIAS, gpios );

printk("Hello World! %s\n", CONFIG_ARCH);
}
I get an error on the pin assignment
ephyr/include/generated/devicetree_unfixed.h:905:30: error: 'DT_N_S_outputs_S_test1_0_P_gpios_IDX_0_VAL_pin' undeclared (first use in this function); did you mean 'DT_N_S_buttons_S_button_0_P_gpios_IDX_0_VAL_pin'? 905 | #define DT_N_ALIAS_test1 DT_N_S_outputs_S_test1_0 | ^~~~~~~~~~~~~~~~~~~~~~~~ /

Do you have a dts binding for compatible = “gpio”.

- k


DeviceTree binding problem #dts #customboard

wbasser@...
 

I created some local GPIO pins in a custom device tree for the project.  It build correctly and I can see the entries in both the "build/zephyr.dts" and "build/includes/generated/devicetree_unfixed.h".  
A snippet below shows the entries in the DTS file for the board
/* These aliases are provided for compatibility with samples */
  aliases {
    led0 = &led0;
    pwm-led0 = &pwm_led0;
    sw0 = &user_button;
    i2c-0 = &sercom2;
    test1 = &test1;
    test2 = &test2;
  };

  outputs {
    compatible = "gpio";
    test1: test1_0 {
      gpios = <&porta 16 0>;
      label = "TEST1";
    };
    test2: test2_0 {
      gpios = <&porta 17 0>;
      label = "TEST2";
    };
  };



In main:
#include <zephyr.h>
#include <sys/printk.h>
#include <devicetree.h>
#include <drivers/gpio.h>

#define TEST1_ALIAS DT_ALIAS( test1 )

void main(void)
{
  uint32_t  uPin;

  uPin = DT_GPIO_PINTEST1_ALIAS, gpios );
  
      printk("Hello World! %s\n", CONFIG_ARCH);
}
I get an error on the pin assignment
ephyr/include/generated/devicetree_unfixed.h:905:30: error: 'DT_N_S_outputs_S_test1_0_P_gpios_IDX_0_VAL_pin' undeclared (first use in this function); did you mean 'DT_N_S_buttons_S_button_0_P_gpios_IDX_0_VAL_pin'? 905 | #define DT_N_ALIAS_test1 DT_N_S_outputs_S_test1_0 | ^~~~~~~~~~~~~~~~~~~~~~~~ /
 


Re: CANbus to USB using Zephyr ?

Henrik Brix Andersen
 

Hi,

I was actually working on one a while back. It was not native USB, but used USB CDC-ACM for exposing an Serial-Line Discipline CAN (slcan) compatible interface.
I will see if I can resurrect it and submit it as a sample.

Brgds,
Brix
--
Henrik Brix Andersen

On 24 Mar 2021, at 22.40, popeye22202 <kjh@hokulea.org> wrote:

Is there CANbus to USB code using Zephyr ? I seem to recall seeing a
reference to one in a slide deck ... but didn't make a note of it.

FYI, there is a number of "bare metal" code :

https://github.com/kkuchera/canalyze-fw ... part of
https://kkuchera.github.io/canalyze ...

https://github.com/normaldotcom/candleLight_fw

https://github.com/krumboeck/usb2can_firmware (for STR750FV2)




61 - 80 of 2599