Date   

west: CMake Error while building blinky

Mohamed Belaroussi <mohamed.belaroussi@...>
 

Hi,

While trying to build the sample example blinky for the nRF5340pdk using west, I encountered this error.

C:\zephyrproject\zephyr>west build -b nrf5340pdk_nrf5340_cpuapp samples\basic\blinky --pristine
-- 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:/zephyrproject/zephyr/samples/basic/blinky
-- Zephyr version: 2.3.99 (C:/zephyrproject/zephyr)
-- Found Python3: C:/Program Files/WindowsApps/PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0/python3.8.exe (found suitable version "3.8.5", minimum required is "3.6") found components: Interpreter
-- Found west: C:/Zypher/v1.3.0/toolchain/opt/bin/Scripts/west.exe (found suitable version "0.7.3", minimum required is "0.7.1")
-- Board: nrf5340pdk_nrf5340_cpuapp
-- Found toolchain: gnuarmemb (c:/gnuarm)
CMake Error at C:/zephyrproject/zephyr/cmake/compiler/gcc/generic.cmake:8 (message):
  Zephyr was unable to find the toolchain.  Is the environment misconfigured?


  User-configuration:

  ZEPHYR_TOOLCHAIN_VARIANT: gnuarmemb

  Internal variables:

  CROSS_COMPILE: c:/gnuarm/bin/arm-none-eabi-

  TOOLCHAIN_HOME: c:/gnuarm

Call Stack (most recent call first):
  C:/zephyrproject/zephyr/cmake/generic_toolchain.cmake:70 (include)
  C:/zephyrproject/zephyr/cmake/app/boilerplate.cmake:527 (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:4 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' '-DWEST_PYTHON=C:\Users\mohamed.belaroussi\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' '-BC:\zephyrproject\zephyr\build' '-SC:\zephyrproject\zephyr\samples\basic\blinky' -GNinja -DBOARD=nrf5340pdk_nrf5340_cpuapp

 
Any suggestions?

Kind regards
Mohamed Belaroussi



Please consider the environment before printing this email.
*********************************************************************
This communication may contain information which is confidential, personal and/or privileged. It is for the exclusive use of the intended recipient(s).
If you are not the intended recipient(s), please note that any distribution, forwarding, copying or use of this communication or the information in it is strictly prohibited. If you have received it in error please contact the sender immediately by return e-mail. Please then delete the e-mail and any copies of it and do not use or disclose its contents to any person.
Any personal views expressed in this e-mail are those of the individual sender and the company does not endorse or accept responsibility for them. Prior to taking any action based upon this e-mail message, you should seek appropriate confirmation of its authenticity.
This message has been checked for viruses on behalf of the company.
*********************************************************************


G4S Regional Management (UK&I) Limited, Registered Office: Southside, 105 Victoria Street, London, SW1E 6QT. Registered in England No. 3189802.

G4S Care and Justice Services (UK) Limited, trading as G4S Central Government Services, Registered in England No. 390328.
G4S Health Services (UK) Limited, Registered in England No. 5121608.
G4S Government and Outsourcing Services (UK) Limited, trading as G4S Outsourcing Services, Registered in England No.3175173.
G4S Facilities Management (UK) Limited, Registered in England No. 3333860.
G4S Investigation Solutions (UK) Limited, Registered in England No. 3749819.
G4S Monitoring Technologies Limited, Registered in England No. 2626613.
G4S Ordnance Management Limited, Registered in England No. 7068855.
G4S Risk Management Limited, Registered in England No. 1540857.
G4S Secure Solutions (Iraq) Limited, Registered in England No.5128617.
G4S Risk Consulting Limited, Registered in England No. 4047630.
The Registered office of all the above companies is Southside, 105 Victoria Street, London, SW1E 6QT.

G4S Aviation Services (UK) Limited, Registered in England No. 2837136.
G4S Secure Solutions (UK) Limited, Registered in England No. 1046019.
G4S Security Services (UK) Limited, Registered in England No.2380900.
G4S Gurkha Services (UK) Limited, Registered in England No.6304482.
G4S Cash Solutions (UK) Limited, Registered in England No.354883.
G4S Cash Centres (UK) Limited, Registered in England No.1485104.
G4S Bullion Solutions (UK) Limited, Registered in England No.7860383.
The Registered office of all the above companies is Sutton Park House, 15 Carshalton Road, Sutton, Surrey SM1 4LD. 


Re: Chocolatey: vcredist140 and Python3 failed to install

Mohamed Belaroussi <mohamed.belaroussi@...>
 

Hi Marti,

Thank you.
No, I haven't. But what I have done is reboot my machine and when I tried to re-run the same command again it returned a message saying all apps have been successfully installed including the two vcredist140 and python3 that seemingly didn't get installed prior to the reboot.
So, the problem disappeared just by rebooting.

Kind regards
Mohamed


On Fri, Aug 28, 2020 at 5:18 PM Bolivar, Marti <Marti.Bolivar@...> wrote:
Hi there and welcome.

"Mohamed Belaroussi via lists.zephyrproject.org"
<mohamed.belaroussi=uk.g4s.com@...> writes:

> *Installing vcredist140-x64...*
> Chocolatey timed out waiting for the command to finish. The timeout
>  specified (or the default value) was '2700' seconds. Perhaps try a
>  higher `--execution-timeout`? See `choco -h` for details.
>   vcredist140 may be able to be automatically uninstalled.
> The install of vcredist140 was NOT successful.

This seems to be a potential cause of the problem and the output
suggests a solution. Did you try looking into this?

Thanks
Martí


Please consider the environment before printing this email.
*********************************************************************
This communication may contain information which is confidential, personal and/or privileged. It is for the exclusive use of the intended recipient(s).
If you are not the intended recipient(s), please note that any distribution, forwarding, copying or use of this communication or the information in it is strictly prohibited. If you have received it in error please contact the sender immediately by return e-mail. Please then delete the e-mail and any copies of it and do not use or disclose its contents to any person.
Any personal views expressed in this e-mail are those of the individual sender and the company does not endorse or accept responsibility for them. Prior to taking any action based upon this e-mail message, you should seek appropriate confirmation of its authenticity.
This message has been checked for viruses on behalf of the company.
*********************************************************************


G4S Regional Management (UK&I) Limited, Registered Office: Southside, 105 Victoria Street, London, SW1E 6QT. Registered in England No. 3189802.

G4S Care and Justice Services (UK) Limited, trading as G4S Central Government Services, Registered in England No. 390328.
G4S Health Services (UK) Limited, Registered in England No. 5121608.
G4S Government and Outsourcing Services (UK) Limited, trading as G4S Outsourcing Services, Registered in England No.3175173.
G4S Facilities Management (UK) Limited, Registered in England No. 3333860.
G4S Investigation Solutions (UK) Limited, Registered in England No. 3749819.
G4S Monitoring Technologies Limited, Registered in England No. 2626613.
G4S Ordnance Management Limited, Registered in England No. 7068855.
G4S Risk Management Limited, Registered in England No. 1540857.
G4S Secure Solutions (Iraq) Limited, Registered in England No.5128617.
G4S Risk Consulting Limited, Registered in England No. 4047630.
The Registered office of all the above companies is Southside, 105 Victoria Street, London, SW1E 6QT.

G4S Aviation Services (UK) Limited, Registered in England No. 2837136.
G4S Secure Solutions (UK) Limited, Registered in England No. 1046019.
G4S Security Services (UK) Limited, Registered in England No.2380900.
G4S Gurkha Services (UK) Limited, Registered in England No.6304482.
G4S Cash Solutions (UK) Limited, Registered in England No.354883.
G4S Cash Centres (UK) Limited, Registered in England No.1485104.
G4S Bullion Solutions (UK) Limited, Registered in England No.7860383.
The Registered office of all the above companies is Sutton Park House, 15 Carshalton Road, Sutton, Surrey SM1 4LD. 


Re: Chocolatey: vcredist140 and Python3 failed to install

Bolivar, Marti
 

Hi there and welcome.

"Mohamed Belaroussi via lists.zephyrproject.org"
<mohamed.belaroussi=uk.g4s.com@lists.zephyrproject.org> writes:

*Installing vcredist140-x64...*
Chocolatey timed out waiting for the command to finish. The timeout
specified (or the default value) was '2700' seconds. Perhaps try a
higher `--execution-timeout`? See `choco -h` for details.
vcredist140 may be able to be automatically uninstalled.
The install of vcredist140 was NOT successful.
This seems to be a potential cause of the problem and the output
suggests a solution. Did you try looking into this?

Thanks
Martí


Re: FIFO is not empty after getting all data items; reference pointer still points to another item

Carles Cufi
 

Hi Dominik,

 

>. Is there a reason why Zephyr does not copy the items to the queue like FreeRTOS does it? The Zephyr documentation lacks this kind of information!

 

FIFOs do not copy the contents of the message, they only store the pointer in a linked list. Maybe this is not clear enough in the documentation, please consider sending a Pull Request enhancing the doc.

 

If you need the kernel to copy the contents of your message for you, you can use Message Queues:

https://docs.zephyrproject.org/latest/reference/kernel/data_passing/message_queues.html

 

Thanks,

 

Carles

 

From: users@... <users@...> On Behalf Of Weber, Dominik via lists.zephyrproject.org
Sent: 28 August 2020 13:22
To: users@...
Subject: [Zephyr-users] FIFO is not empty after getting all data items; reference pointer still points to another item

 

Hey everyone,

 

I’m currently having problems when putting items to a FIFO. As long as I put data items to my FIFO queue, everything is ok and works as expected. If I stop putting data to the queue, the reading thread continues reading the last data item out of the queue over and over again, although the queue should be empty but is not (k_fifo_is_empty() says it’s not empty).

 

There’s a writing and a reading thread in my software project.

 

I have the following data item, defined in the header file of the reading thread:

 

typedef struct

{

    void *fifoReserved;     ///< 1st word reserved for use by fifo

    int data1;               

    int data2;              

 

s_data_item_fifo_ecg_t;

 

 

 

 

The writing thread is like:

 

(This is a static variable in the software module)

static s_data_item_fifo_ecg_t ecgDataStruct;  ///< This data item contains the ecg information to put to the data fifo.

 

(Inside the thread)

while (1)

    {

        /* Thread will be unready until signal was raised, signal will be raised when data ready interrupt comes */

        k_poll(daEvents1, K_FOREVER);

 

        /* Reset signal */

        daEvents[0].signal->signaled = 0;

        daEvents[0].state = K_POLL_STATE_NOT_READY;

 

        /* …get data from hardware chip here… */

 

        ecgDataStruct.data1 = ;

        ecgDataStruct.data2 = ;

 

        dataProcessingPutFifoECG(&ecgDataStruct);

    }

 

The last function is part of the reading thread software module and just puts the item to the queue with k_fifo_put().

 

 

 

The reading thread is like:

 

(This is a static variable in the software module)

static struct k_fifo dpFifoECG;      ///< FIFO structure for handling incoming ECG data

 

There is an init function, where this is called:

k_fifo_init(&dpFifoECG);

 

 

s_data_item_fifo_ecg_t *fifoDataECG;

 

    while (1

    {

        /* Get data from queue. */

        fifoDataECG = k_fifo_get(&dpFifoECG, K_FOREVER);

 

        printk("%d,%d\n"fifoDataECG->data1fifoDataECG->data2);

 

    }

 

I checked the print outputs with a terminal program and realized that the data is still printed, even if I stop the measurement and stop putting data to the queue, which means that the program is not waiting at k_fifo_get() as expected. It just continues reading the last item which should be removed from the queue.

 

When I have a look at the fifoReserved pointer for these unwanted items, I see that the pointer is always the same and not NULL. Shouldn’t the pointer be NULL if there are no more items in the list?

 

This is really driving me crazy.

 

Both threads do have a maximum memory thread stack size of 8kB.

 

The priorities are -2 for the writing thread (implements SPI communication) and 1 for the reading thread. (There are three threads running on the system, excluding main thread and idle thread).

 

A general question:

 

For me, it is not really clear, if a data item is passed by copy or by reference to the fifo queue. I assume, the items are passed by reference, since I faced some serious problems when passing data items from an ISR, which are lying on the ISR stack. The content of the data item was sometimes different after reading the item compared to when the item was putted to the queue. The solution to this problem was to define a static data item on the memory heap of the software module and to only adjust the data of the same item and put it again to the queue. This seems very unintuitive to me, since I put the same item to the queue over and over again, only with different content. Is there a reason why Zephyr does not copy the items to the queue like FreeRTOS does it? The Zephyr documentation lacks this kind of information!

 

My setup:

  • Zephyr 2.3 Build 99
  • Nordic nRF52840 DK
  • Segger J-Link OB-SAM3U128-V2-NordicSemi
  • Eclipse 2019-09
  • Python 3.8.3
  • West 0.7.2
  • C compiler GNU 9.2.1

 

Thanks for your help!

 


FIFO is not empty after getting all data items; reference pointer still points to another item

Weber, Dominik <dominik.weber@...>
 

Hey everyone,

 

I’m currently having problems when putting items to a FIFO. As long as I put data items to my FIFO queue, everything is ok and works as expected. If I stop putting data to the queue, the reading thread continues reading the last data item out of the queue over and over again, although the queue should be empty but is not (k_fifo_is_empty() says it’s not empty).

 

There’s a writing and a reading thread in my software project.

 

I have the following data item, defined in the header file of the reading thread:

 

typedef struct

{

    void *fifoReserved;     ///< 1st word reserved for use by fifo

    int data1;               

    int data2;              

 

s_data_item_fifo_ecg_t;

 

 

 

 

The writing thread is like:

 

(This is a static variable in the software module)

static s_data_item_fifo_ecg_t ecgDataStruct;  ///< This data item contains the ecg information to put to the data fifo.

 

(Inside the thread)

while (1)

    {

        /* Thread will be unready until signal was raised, signal will be raised when data ready interrupt comes */

        k_poll(daEvents1, K_FOREVER);

 

        /* Reset signal */

        daEvents[0].signal->signaled = 0;

        daEvents[0].state = K_POLL_STATE_NOT_READY;

 

        /* …get data from hardware chip here… */

 

        ecgDataStruct.data1 = ;

        ecgDataStruct.data2 = ;

 

        dataProcessingPutFifoECG(&ecgDataStruct);

    }

 

The last function is part of the reading thread software module and just puts the item to the queue with k_fifo_put().

 

 

 

The reading thread is like:

 

(This is a static variable in the software module)

static struct k_fifo dpFifoECG;      ///< FIFO structure for handling incoming ECG data

 

There is an init function, where this is called:

k_fifo_init(&dpFifoECG);

 

 

s_data_item_fifo_ecg_t *fifoDataECG;

 

    while (1

    {

        /* Get data from queue. */

        fifoDataECG = k_fifo_get(&dpFifoECG, K_FOREVER);

 

        printk("%d,%d\n"fifoDataECG->data1fifoDataECG->data2);

 

    }

 

I checked the print outputs with a terminal program and realized that the data is still printed, even if I stop the measurement and stop putting data to the queue, which means that the program is not waiting at k_fifo_get() as expected. It just continues reading the last item which should be removed from the queue.

 

When I have a look at the fifoReserved pointer for these unwanted items, I see that the pointer is always the same and not NULL. Shouldn’t the pointer be NULL if there are no more items in the list?

 

This is really driving me crazy.

 

Both threads do have a maximum memory thread stack size of 8kB.

 

The priorities are -2 for the writing thread (implements SPI communication) and 1 for the reading thread. (There are three threads running on the system, excluding main thread and idle thread).

 

A general question:

 

For me, it is not really clear, if a data item is passed by copy or by reference to the fifo queue. I assume, the items are passed by reference, since I faced some serious problems when passing data items from an ISR, which are lying on the ISR stack. The content of the data item was sometimes different after reading the item compared to when the item was putted to the queue. The solution to this problem was to define a static data item on the memory heap of the software module and to only adjust the data of the same item and put it again to the queue. This seems very unintuitive to me, since I put the same item to the queue over and over again, only with different content. Is there a reason why Zephyr does not copy the items to the queue like FreeRTOS does it? The Zephyr documentation lacks this kind of information!

 

My setup:

·         Zephyr 2.3 Build 99

·         Nordic nRF52840 DK

·         Segger J-Link OB-SAM3U128-V2-NordicSemi

·         Eclipse 2019-09

·         Python 3.8.3

·         West 0.7.2

·         C compiler GNU 9.2.1

 

Thanks for your help!

 


Chocolatey: vcredist140 and Python3 failed to install

Mohamed Belaroussi <mohamed.belaroussi@...>
 

Hello,

This is the first time I am posting on this forum asking you guys if you could help me figure out what is causing the installation of vcredist140 and python3 to fail. 
Please let me know if this is not the right forum to ask for help.

I installed chocolatey successfully. I then opened a cmd window in administrator mode and ran the following commands.

·        choco feature enable -n allowGlobalConfirmation

·        choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'

·        choco install ninja gperf python git


The first two completed OK but the third one in red failed with the following errors. Note, I already have Python 3.8.2 installed on my machine at "c:\Program Files\Python3.8.2".

vcredist140 v14.26.28720.3 [Approved]
vcredist140 package files install completed. Performing other installation steps.
Downloading vcredist140-x86
  from 'https://download.visualstudio.microsoft.com/download/pr/d60aa805-26e9-47df-b4e3-cd6fcc392333/A06AAC66734A618AB33C1522920654DDFC44FC13CAFAA0F0AB85B199C3D51DC0/VC_redist.x86.exe'
Progress: 100% - Completed download of C:\Users\mohamed.belaroussi\AppData\Local\Temp\chocolatey\vcredist140\14.26.28720.3\VC_redist.x86.exe (13.75 MB).
Download of VC_redist.x86.exe (13.75 MB) completed.
Hashes match.
Installing vcredist140-x86...
vcredist140-x86 has been installed.
Downloading vcredist140-x64 64 bit
  from 'https://download.visualstudio.microsoft.com/download/pr/d60aa805-26e9-47df-b4e3-cd6fcc392333/7D7105C52FCD6766BEEE1AE162AA81E278686122C1E44890712326634D0B055E/VC_redist.x64.exe'
Progress: 100% - Completed download of C:\Users\mohamed.belaroussi\AppData\Local\Temp\chocolatey\vcredist140\14.26.28720.3\VC_redist.x64.exe (14.28 MB).
Download of VC_redist.x64.exe (14.28 MB) completed.
Hashes match.
Installing vcredist140-x64...
Chocolatey timed out waiting for the command to finish. The timeout
 specified (or the default value) was '2700' seconds. Perhaps try a
 higher `--execution-timeout`? See `choco -h` for details.

  vcredist140 may be able to be automatically uninstalled.
The install of vcredist140 was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\vcredist140\tools\chocolateyInstall.ps1'.
 See log for details.


python3 v3.8.5.20200721 [Approved]
python3 package files install completed. Performing other installation steps.
Installing 64-bit python3...
WARNING: Another installation currently in progress. Try again later.
ERROR: Running ["C:\ProgramData\chocolatey\lib\python3\tools\python-3.8.5-amd64.exe" /quiet InstallAllUsers=1 PrependPath=1 TargetDir="C:\Python38" ] was not successful. Exit code was '1618'. Exit code indicates the following: Another installation currently in progress. Try again later..
The install of python3 was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\python3\tools\chocolateyInstall.ps1'.
 See log for details.


python v3.8.5.20200721 [Approved]
python package files install completed. Performing other installation steps.
 The install of python was successful.
  Software install location not explicitly set, could be in package or
  default install location if installer.
Progress: Downloading git.install 2.28.0... 100%
Progress: Downloading git 2.28.0... 100%

Thank you.

Kind regards


Mohamed Belaroussi
Senior Embedded Systems Design Engineer
G4S Monitoring Technologies

3 Centurion Court, Meridian Business Park, Leicester, LE19 1TP
Tel:     0116 2820184 (internal: 281)


Please consider the environment before printing this email.
*********************************************************************
This communication may contain information which is confidential, personal and/or privileged. It is for the exclusive use of the intended recipient(s).
If you are not the intended recipient(s), please note that any distribution, forwarding, copying or use of this communication or the information in it is strictly prohibited. If you have received it in error please contact the sender immediately by return e-mail. Please then delete the e-mail and any copies of it and do not use or disclose its contents to any person.
Any personal views expressed in this e-mail are those of the individual sender and the company does not endorse or accept responsibility for them. Prior to taking any action based upon this e-mail message, you should seek appropriate confirmation of its authenticity.
This message has been checked for viruses on behalf of the company.
*********************************************************************


G4S Regional Management (UK&I) Limited, Registered Office: Southside, 105 Victoria Street, London, SW1E 6QT. Registered in England No. 3189802.

G4S Care and Justice Services (UK) Limited, trading as G4S Central Government Services, Registered in England No. 390328.
G4S Health Services (UK) Limited, Registered in England No. 5121608.
G4S Government and Outsourcing Services (UK) Limited, trading as G4S Outsourcing Services, Registered in England No.3175173.
G4S Facilities Management (UK) Limited, Registered in England No. 3333860.
G4S Investigation Solutions (UK) Limited, Registered in England No. 3749819.
G4S Monitoring Technologies Limited, Registered in England No. 2626613.
G4S Ordnance Management Limited, Registered in England No. 7068855.
G4S Risk Management Limited, Registered in England No. 1540857.
G4S Secure Solutions (Iraq) Limited, Registered in England No.5128617.
G4S Risk Consulting Limited, Registered in England No. 4047630.
The Registered office of all the above companies is Southside, 105 Victoria Street, London, SW1E 6QT.

G4S Aviation Services (UK) Limited, Registered in England No. 2837136.
G4S Secure Solutions (UK) Limited, Registered in England No. 1046019.
G4S Security Services (UK) Limited, Registered in England No.2380900.
G4S Gurkha Services (UK) Limited, Registered in England No.6304482.
G4S Cash Solutions (UK) Limited, Registered in England No.354883.
G4S Cash Centres (UK) Limited, Registered in England No.1485104.
G4S Bullion Solutions (UK) Limited, Registered in England No.7860383.
The Registered office of all the above companies is Sutton Park House, 15 Carshalton Road, Sutton, Surrey SM1 4LD. 


Blocking printk #usb #nrf52840

forum.contas@...
 

Hi to everyone:

First post.

I've a simple Zephyr RTOS program where I use USB CDC ACM to see the output of the console and also the printk output.

Everything works fine, if I connect a terminal program to see the output.

If I do not connect a terminal program at start up (power on) the thread that has the printk just blocks. All other threads continue to run fine.

If after a while I connect the terminal program I can see some buffered output, and work resumes ok.

If I wait to much the thread never recovers, by other words I get no output and it seems that the thread is hanged and non functional.

Any idea how to make the USB output non blockcable or just overrun any output buffer?


Re: Flash two firmware in flash and jump from one address to another #flash #nrf52480

Nikos Karamolegkos
 

Hello,

Update: I just want to change the boot address (or slot) before the reboot, without using MCUboot. I am looking on zephyr documentation for a mechanism like this but I can not find any utility. Any proposals/ideas?

Thank you

On 8/25/20 8:31 PM, Nikos Karamolegkos wrote:

Thank you Carles, I would prefer not to use MCUboot. However, I have already checked MCUboot code in order to take some ideas. I am looking for something MCUboot interdependent. For example a function that change the boot address before the reboot.

On 8/25/20 5:22 PM, Cufi, Carles wrote:

Hi Nikos,

 

Maybe you want to look at MCUboot, which supports this out of the box and is integrated with Zephyr?

https://mcuboot.com/

 

https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BOOTLOADER_MCUBOOT.html#cmdoption-arg-config-bootloader-mcuboot

 

Thanks,

 

Carles

 

From: users@... <users@...> On Behalf Of Nikos Karamolegkos via lists.zephyrproject.org
Sent: 25 August 2020 15:52
To: users@...
Subject: [Zephyr-users] Flash two firmware in flash and jump from one address to another #flash #nrf52480

 

Hello, I am using nrf52840-dk module (this is not really important). I would like to write two different firmwares in my device in different addresses (slots). Lets say the first firmware is located at address 0x000 (slot 0) and the second one is located at address 0x0000C000 (slot 1). How can I flash these two firmwares in these two different addresses and how can my application jump from the one address to the other (after reboot)?

Thanks,
Nikos

-- 
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)
-- 
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)


Re: Bluetooth: Concurrent advertising

Christoph Schramm
 

Hi Vinayak,

thanks a lot for your reply.

I have always been afraid of this but always assumed there will be a solution if we actually hit this worst case. Wow. I mean, with all the Corona apps rolling out, it would be really simple (for a flat earther, anti-vaxxer, etc.) to create a device which "bruteforces" all the smartphones around to render the Corona apps useless.
However, that's out of scope for Zephyr.

Thanks, again
Chris



Am 27.08.20, 09:01 schrieb "users@lists.zephyrproject.org im Auftrag von Chettimada, Vinayak Kariappa via lists.zephyrproject.org" <users@lists.zephyrproject.org im Auftrag von vinayak.kariappa.chettimada=nordicsemi.no@lists.zephyrproject.org>:

Hi Chris,

Only one connectable advertising instance is supported in the zephyr controller. Multiple simultaneous connections are supported, but that is not going to help denial of service if you do not want to authenticate a connecting central.
It is normal for centrals to support multiple simultaneous connections and your rogue master would connect to all your multiple advertisings attempts.

> one might want to advertise an eddystone beacon and a sensor peripheral at the same time
You either do this by advertising connectable and then after a connection you start a non-connectable advertising. This is supported in current zephyr BT stack.
If you want simultaneous instances of advertisers with different advertising data/mode, then you need advertising extensions support.
Zephyr host has support for advertising extensions, but you will need to check if the controller you use supports it.
Zephyr open source controller for nRF52 does not (its work in progress), but Nordic's proprietary softdevice controller in the nRF Connect SDK fully supports advertising extensions.

That said, again, without authentication, you can only use back-off to avoid denial of service if a central is always trying to connect to your device. There is no deny list for devices.

Regards,
Vinayak


-----Original Message-----
From: users@lists.zephyrproject.org <users@lists.zephyrproject.org> On Behalf Of Christoph Schramm via lists.zephyrproject.org
Sent: 26 August 2020 22:12
To: users@lists.zephyrproject.org
Subject: [Zephyr-users] Bluetooth: Concurrent advertising

Dear All,

One of our devices installed on a remote location is under some sort of „denial-of-service“ attack - well, that‘s simply meaning someone is constantly connecting to our peripheral, thus blocking other connections.
We can‘t use bonding (because of the UX impact with auth code in apps), so my only idea is to continue advertising even while a (rogue) central is connected.
I thought this would be the default for BT_LE_ADV_CONN but as it seems, it‘s not: the peripheral stops advertising and only resumes after the central disconnected.
However, I always wondered if it‘s possible to have multiple concurrent advertising „virtual“ peripherals. I can see that the ticker API is referenced a lot, so at first glance it looks like it was a common use case. But I absolutely can‘t find any documentation of how to start multiple advertisements (just to give a simple example: one might want to advertise an eddystone beacon and a sensor peripheral at the same time)

Any help is greatly appreciated

Chris


Re: Bluetooth: Concurrent advertising

Chettimada, Vinayak Kariappa
 

Hi Chris,

Only one connectable advertising instance is supported in the zephyr controller. Multiple simultaneous connections are supported, but that is not going to help denial of service if you do not want to authenticate a connecting central.
It is normal for centrals to support multiple simultaneous connections and your rogue master would connect to all your multiple advertisings attempts.

one might want to advertise an eddystone beacon and a sensor peripheral at the same time
You either do this by advertising connectable and then after a connection you start a non-connectable advertising. This is supported in current zephyr BT stack.
If you want simultaneous instances of advertisers with different advertising data/mode, then you need advertising extensions support.
Zephyr host has support for advertising extensions, but you will need to check if the controller you use supports it.
Zephyr open source controller for nRF52 does not (its work in progress), but Nordic's proprietary softdevice controller in the nRF Connect SDK fully supports advertising extensions.

That said, again, without authentication, you can only use back-off to avoid denial of service if a central is always trying to connect to your device. There is no deny list for devices.

Regards,
Vinayak


-----Original Message-----
From: users@lists.zephyrproject.org <users@lists.zephyrproject.org> On Behalf Of Christoph Schramm via lists.zephyrproject.org
Sent: 26 August 2020 22:12
To: users@lists.zephyrproject.org
Subject: [Zephyr-users] Bluetooth: Concurrent advertising

Dear All,

One of our devices installed on a remote location is under some sort of „denial-of-service“ attack - well, that‘s simply meaning someone is constantly connecting to our peripheral, thus blocking other connections.
We can‘t use bonding (because of the UX impact with auth code in apps), so my only idea is to continue advertising even while a (rogue) central is connected.
I thought this would be the default for BT_LE_ADV_CONN but as it seems, it‘s not: the peripheral stops advertising and only resumes after the central disconnected.
However, I always wondered if it‘s possible to have multiple concurrent advertising „virtual“ peripherals. I can see that the ticker API is referenced a lot, so at first glance it looks like it was a common use case. But I absolutely can‘t find any documentation of how to start multiple advertisements (just to give a simple example: one might want to advertise an eddystone beacon and a sensor peripheral at the same time)

Any help is greatly appreciated

Chris


Bluetooth: Concurrent advertising

Christoph Schramm
 

Dear All,

One of our devices installed on a remote location is under some sort of „denial-of-service“ attack - well, that‘s simply meaning someone is constantly connecting to our peripheral, thus blocking other connections.
We can‘t use bonding (because of the UX impact with auth code in apps), so my only idea is to continue advertising even while a (rogue) central is connected.
I thought this would be the default for BT_LE_ADV_CONN but as it seems, it‘s not: the peripheral stops advertising and only resumes after the central disconnected.
However, I always wondered if it‘s possible to have multiple concurrent advertising „virtual“ peripherals. I can see that the ticker API is referenced a lot, so at first glance it looks like it was a common use case. But I absolutely can‘t find any documentation of how to start multiple advertisements (just to give a simple example: one might want to advertise an eddystone beacon and a sensor peripheral at the same time)

Any help is greatly appreciated

Chris


RFC: remove w25qxxdv flash driver from Zephyr as of 2.4.0

Peter A. Bigot
 

The spi_flash_w25qxxdv driver has been superseded by the generic spi_nor driver for over a year. The only non-refactoring change to the W25Q driver in the last 18 months was done to support a backport to 1.14.

All devices supported by spi_flash_w25qxxdv driver are expected to be supported by the spi_nor driver, using the standard jedec,spi-nor devicetree compatible. No in-tree devicetree files make use of this driver.

To reduce confusion about which driver is expected to be used for JEDEC-standard SPI NOR serial flash memories pull request 27802 proposes to remove the redundant driver from Zephyr 2.4.  (It's not practical to deprecate a driver, and the existing one will work only for winbond,w25q16 if anything.

Please raise any concerns you have with this proposal as comments/reviews on the pull request.

Peter


Re: Debugging with Eclipse and PyOCD: Uncaught Exception in pyocd.exe

Weber, Dominik <dominik.weber@...>
 

Hey Marti,

Thanks for your help. The version 0.24.0 of pyocd was in fact the problem (obviously there was a bug). I installed the latest version and it works now!

Thanks!

Best Regards,
Dominik

-----Ursprüngliche Nachricht-----
Von: Bolivar, Marti <Marti.Bolivar@nordicsemi.no>
Gesendet: Dienstag, 11. August 2020 18:47
An: Weber, Dominik <dominik.weber@iis.fraunhofer.de>;
users@lists.zephyrproject.org
Betreff: Re: [Zephyr-users] Debugging with Eclipse and PyOCD: Uncaught
Exception in pyocd.exe

Hi, responses inline.

"Weber, Dominik via lists.zephyrproject.org"
<dominik.weber=iis.fraunhofer.de@lists.zephyrproject.org> writes:

Hello there,

I'm new to Zephyr and having some trouble with debugging my application
with PyOCD and Eclipse. I'm running a multithreaded application on a
nRF52840 DK. I flash and want to debug the application via the onboard
debugger on the DK. I followed the steps described in the tutorial:
https://docs.zephyrproject.org/2.3.0/application/index.html#application in
the section "Eclipse Debugging".

I use:

* Zephyr 2.3 Build 99

* Segger J-Link OB-SAM3U128-V2-NordicSemi

* Eclipse 2019-09

* Python 3.8.3

* West 0.7.2

* C compiler GNU 9.2.1

All Python dependencies for Zephyr are satisfied.
Does this mean you installed the latest pyocd? The zephyr
requirements-run-test.txt file from which pyocd comes just says:

pyocd>=0.24.0

The version of this tool is likely what is at issue.


When I try to debug the application via pyocd.exe or pyocd-gdbserver.exe I
get the following error:

0001289:CRITICAL:__main__:uncaught exception: 'JLinkProbe' object has no
attribute '_lock'
Traceback (most recent call last):
File "c:\python38\lib\site-packages\pyocd\__main__.py", line 362, in run
self._COMMANDS[self._args.cmd](self)
File "c:\python38\lib\site-packages\pyocd\__main__.py", line 680, in
do_gdbserver
with session:
File "c:\python38\lib\site-packages\pyocd\core\session.py", line 302, in
__enter__
self.open()
File "c:\python38\lib\site-packages\pyocd\core\session.py", line 420, in
open
self._board.init()
File "c:\python38\lib\site-packages\pyocd\board\board.py", line 85, in init
self.target.init()
File "c:\python38\lib\site-packages\pyocd\core\coresight_target.py", line
160, in init
seq.invoke()
File "c:\python38\lib\site-packages\pyocd\utility\sequencer.py", line 213,
in invoke
resultSequence.invoke()
File "c:\python38\lib\site-packages\pyocd\utility\sequencer.py", line 208,
in invoke
resultSequence = call()
File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 359, in
power_up_debug
self.write_reg(DP_CTRL_STAT, CSYSPWRUPREQ | CDBGPWRUPREQ |
MASKLANE | TRNNORMAL)
File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 348, in
write_reg
self.write_dp(addr, data)
File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 528, in
write_dp
did_lock = self._set_dpbanksel(addr, True)
File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 480, in
_set_dpbanksel
self.lock()
File "c:\python38\lib\site-packages\pyocd\coresight\dap.py", line 252, in
lock
self.probe.lock()
File "c:\python38\lib\site-packages\pyocd\probe\debug_probe.py", line
173, in lock
self._lock.acquire()
AttributeError: 'JLinkProbe' object has no attribute '_lock'

Is this a bug in the python scripts or is the debugger not supported?
This error is coming from pyocd itself. Since it's an AttributeError it
looks like there's probably a bug in the tool. Knowing the exact version
is the next step. I would try manually installing the 0.24.0 version
given in the requirements file if the latest release is buggy here.

I don't understand if "When I try to debug the application via pyocd.exe
or pyocd-gdbserver.exe" means you are using 'west debug' or 'west
debugserver', but if so, you can run in verbose mode to see the pyocd
commands under the hood:

west -v debug

Example output:

$ west -v debug
[...]
-- west debug: using runner pyocd
-- runners.pyocd: pyOCD GDB server running on port 3333
runners.pyocd: pyocd gdbserver -p 3333 -T 4444 -t nrf52840 -f 4000000
runners.pyocd: /home/mbolivar/bin/zephyr-sdk/arm-zephyr-eabi/bin/arm-
zephyr-eabi-gdb /home/mbolivar/zp/zephyr/build/zephyr/zephyr.elf -ex
'target remote :3333' -ex 'monitor halt' -ex 'monitor reset' -ex load

Thanks,
Martí


Thanks for your help!

Best Regards,
Dominik



Re: Flash two firmware in flash and jump from one address to another #flash #nrf52480

Nikos Karamolegkos
 

Thank you Carles, I would prefer not to use MCUboot. However, I have already checked MCUboot code in order to take some ideas. I am looking for something MCUboot interdependent. For example a function that change the boot address before the reboot.

On 8/25/20 5:22 PM, Cufi, Carles wrote:

Hi Nikos,

 

Maybe you want to look at MCUboot, which supports this out of the box and is integrated with Zephyr?

https://mcuboot.com/

 

https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BOOTLOADER_MCUBOOT.html#cmdoption-arg-config-bootloader-mcuboot

 

Thanks,

 

Carles

 

From: users@... <users@...> On Behalf Of Nikos Karamolegkos via lists.zephyrproject.org
Sent: 25 August 2020 15:52
To: users@...
Subject: [Zephyr-users] Flash two firmware in flash and jump from one address to another #flash #nrf52480

 

Hello, I am using nrf52840-dk module (this is not really important). I would like to write two different firmwares in my device in different addresses (slots). Lets say the first firmware is located at address 0x000 (slot 0) and the second one is located at address 0x0000C000 (slot 1). How can I flash these two firmwares in these two different addresses and how can my application jump from the one address to the other (after reboot)?

Thanks,
Nikos

-- 
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)


Re: Flash two firmware in flash and jump from one address to another #flash #nrf52480

Carles Cufi
 

Hi Nikos,

 

Maybe you want to look at MCUboot, which supports this out of the box and is integrated with Zephyr?

https://mcuboot.com/

 

https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BOOTLOADER_MCUBOOT.html#cmdoption-arg-config-bootloader-mcuboot

 

Thanks,

 

Carles

 

From: users@... <users@...> On Behalf Of Nikos Karamolegkos via lists.zephyrproject.org
Sent: 25 August 2020 15:52
To: users@...
Subject: [Zephyr-users] Flash two firmware in flash and jump from one address to another #flash #nrf52480

 

Hello, I am using nrf52840-dk module (this is not really important). I would like to write two different firmwares in my device in different addresses (slots). Lets say the first firmware is located at address 0x000 (slot 0) and the second one is located at address 0x0000C000 (slot 1). How can I flash these two firmwares in these two different addresses and how can my application jump from the one address to the other (after reboot)?

Thanks,
Nikos


API meeting: agenda

Carles Cufi
 


Flash two firmware in flash and jump from one address to another #flash #nrf52480

Nikos Karamolegkos
 

Hello, I am using nrf52840-dk module (this is not really important). I would like to write two different firmwares in my device in different addresses (slots). Lets say the first firmware is located at address 0x000 (slot 0) and the second one is located at address 0x0000C000 (slot 1). How can I flash these two firmwares in these two different addresses and how can my application jump from the one address to the other (after reboot)?

Thanks,
Nikos


How to Request BLE Data Length Extension? #bt #bluetooth

George Ruinelli
 

I am trying to set the Bluetooth Low Energy DLE from 27 to something higher, eg. 251.
I was able to do it manually through the nRF Connect Tool, Wireshark then confirms me that the data no longer is fragmented:


How ever I need to be able to do it directly within Zephyr.

I am aware of https://lists.zephyrproject.org/g/users/topic/data_length_extension_on/23297993 and https://lists.zephyrproject.org/g/devel/topic/30301574, but it did not help me further.

I found bt_conn_le_data_len_update() which seems to do what I need, but it doesn't have any impact.
I tried to add its call to exchange_func(), but it simply seems to be ignored:
static void exchange_func(struct bt_conn *conn, uint8_t att_err, struct bt_gatt_exchange_params *params) {
    struct bt_conn_info info = {0};
    int err;

    if (att_err == 0) {
        LOG_INF("MTU exchange successful");
        LOG_DBG("MTU: %d bytes", bt_gatt_get_mtu(conn));
    }
    else {
        LOG_ERR("MTU exchange failed!");
    }

    err = bt_conn_get_info(conn, &info);
    if (err) {
        LOG_ERR("Failed to get connection info %d\n", err);
    }


    LOG_ERR("Data Length: %d", info.le.data_len->tx_max_len); // Reports 27

    struct bt_conn_le_data_len_param param;
    param.tx_max_len = 251;
    param.tx_max_time = 2120;
    err = bt_conn_le_data_len_update(conn, &param);
    if (err) {
        LOG_ERR("Failed to Update DLE: %d\n", err);
    }

    LOG_ERR("Data Length: %d", info.le.data_len->tx_max_len); // Still reporst 27
}

Sadly searching the web for bt_conn_le_data_len_update() only reveals its documentation but no further information :(

Sincerely
George


Re: Data Length Extension on NRF52840 #nrf52840 #ble #hci

George Ruinelli
 

@Josh

Can you give some insight, how you requested Data Length Extension?
I can not find any documentation how to do this.
I was able to enable to do it manually through the nRF Connect Tool, but need to do it directly in Zephyr.

Sincerely
George


Re: Choosing the network interface for a socket

Jukka Rissanen
 

Hi Maik,

For listening socket you need to call bind() to assing the local
address. For sending socket, the local address (interface) is selected
automatically (if you have not bound the socket) according to
destination address.

Cheers,
Jukka

On Fri, 2020-08-21 at 09:27 +0200, Maik Vermeulen wrote:
Hello,

Currently I am playing with TCP sockets on a board that has both an
LTE-M modem, and an ethernet interface.

It is not clear to me how I can control whether the socket should
use
the LTE-M connection, or the ethernet interface.

Could anyone give me some pointers?

Best regards,
Maik Vermeulen



421 - 440 of 2607