Date   

Linking Prebuilt Binaries

Casey Shea
 

Hello,

I am looking for a method to link prebuilt binaries so that they are included in my zephyr application binary file.  These are not code libraries, they are actually just images of logos that get written to a display at runtime.  In a previous version of this project, using IAR, I was able to do the following:


--image_input logo1.obj,__logo1Start__,EXTERNAL_CONST_FILE,4
--image_input logo2.obj,__logo2Start__,EXTERNAL_CONST_FILE,4

where EXTERNAL_CONST_FILE was defined in the linker definition via the following method:

define block Internal_Code with fixed order 
  ro section .text,
  ro section CODE,
  ro section LOCAL_CODE,
  ro data section EXTERNAL_CONST,
  ro data section EXTERNAL_CONST_FILE,
  ro data section LOCAL_CONST,
  ro data section INTERNAL_CONST,
  ro data section __DLIB_PERTHREAD_init,
  ro data section .iar.init_table,
  ro data section .rodata,
  ro data section .data_init,
  ro code section .xip_section_init,
  block ENDALIGN, 
  block END 
};

This method also allowed me to reference the symbols "__logo1Start__" and "__logo2Start__" from within my C source code.

I'm hoping to find a method for doing something similar in the Zephyr application.  I'm sure I could define a specified memory location and link it into that memory location but I'd rather they just be appended to the the application as an ro data section.

Any ideas?

Thanks!


Re: DFU based on mcumgr and mcuboot not working #mcuboot #stm32

Anders
 

Hi again,

I am still struggling with DFU/MCUboot...

Is there anyone out there that has successfully used MCUboot together with the STM32H7 line of MCU's?

I have updated my build environment to Zephyr 3.1.0 (including west update). Unfortunately the alignment problem when swapping images remains when using v1.9.0 of MCUboot and version 3.1.0 of Zephyr.

Regards,
Anders


Regarding implementation of cache attack codes on Comet Risc V Processor working on Zephyr OS

Pavitra bhade <pavitra19231101@...>
 

Dear Sir/ Madam,

I am a PhD student from Indian Institute of Technology Goa. I am trying to implement a Cache Side Channel attack on Comet Risc V 32 bit processor. I have added the board architecture to the zephyr board directory. However I am trying to implement the following attack on my system.

I have cloned the repositories, but I don't know how to go about the implementation. As of now I was trying my dummy codes by placing them in the samples folder. But as far as these repositories are concerned, kindly guide me how to go about its implementation.

Your help is highly appreciated.

Thanks and Regards,



--
Pavitra Prakash Bhade
Ph.D. Student
Indian Institute of Technology Goa


DFU based on mcumgr and mcuboot not working #mcuboot #stm32

Anders
 

Hi,

For DFU using mcumgr over UDP we have a working configuration based on a version of the manifest-rev branch of mcuboot modified to support 32 byte alignment.
Environment is Zephyr 3.0.0 running on an STM32H743 MCU equipped with an IS25LP032D QSPI flash.

Now, when support for 32 byte alignment has been added to mcuboot we would like to throw away our hack and use the official version of mcuboot instead.

With version 1.9.0 (and 1.10.0-dev) image upload and staging for image swap works fine.
The problem is that the test swap gives this result (here with Zephyr 3.1.0-rc3 but behavior is the same with 3.0.0):

I: IS25LP032D: SFDP v 1.6 AP ff with 1 PH
I: PH0: ff00 rev 1.6: 16 DW @ 30
I: IS25LP032D: 4 MiBy flash
*** Booting Zephyr OS build v3.1.0-rc3-32-g801fe1fa06bd ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Scratch: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: primary slot
I: Swap type: test
I: Starting swap using scratch algorithm.
E: Write offset not aligned on flashword length. Offset: 0x1ffff0, flashword length: 32
E: Write range invalid. Offset: 2097136, len: 16
E: Write offset not aligned on flashword length. Offset: 0x1fff70, flashword length: 32
E: Write range invalid. Offset: 2097008, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1fff90, flashword length: 32
E: Write range invalid. Offset: 2097040, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1b3fd0, flashword length: 32
E: Write range invalid. Offset: 1785808, len: 64
E: Write offset not aligned on flashword length. Offset: 0x1bfff0, flashword length: 32
E: Write range invalid. Offset: 1834992, len: 16
E: Write offset not aligned on flashword length. Offset: 0x1b4010, flashword length: 32
E: Write range invalid. Offset: 1785872, len: 32
E: Status Bank2: 0x00800000
E: Write offset not aligned on flashword length. Offset: 0x1b4030, flashword length: 32
E: Write range invalid. Offset: 1785904, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1b4050, flashword length: 32
E: Write range invalid. Offset: 1785936, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1b4070, flashword length: 32
E: Write range invalid. Offset: 1785968, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1b4090, flashword length: 32
E: Write range invalid. Offset: 1786000, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1b40b0, flashword length: 32
E: Write range invalid. Offset: 1786032, len: 32
E: Status Bank2: 0x00800000
E: Write offset not aligned on flashword length. Offset: 0x1b40d0, flashword length: 32
E: Write range invalid. Offset: 1786064, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1b40f0, flashword length: 32
E: Write range invalid. Offset: 1786096, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1b4110, flashword length: 32
E: Write range invalid. Offset: 1786128, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1b4130, flashword length: 32
E: Write range invalid. Offset: 1786160, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1b4150, flashword length: 32
E: Write range invalid. Offset: 1786192, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1b4170, flashword length: 32
E: Write range invalid. Offset: 1786224, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1b4190, flashword length: 32
E: Write range invalid. Offset: 1786256, len: 32
E: Status Bank2: 0x00810000
E: Write offset not aligned on flashword length. Offset: 0x1b41b0, flashword length: 32
E: Write range invalid. Offset: 1786288, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1b41d0, flashword length: 32
E: Write range invalid. Offset: 1786320, len: 32
E: Write offset not aligned on flashword length. Offset: 0x1b41f0, flashword length: 32
E: Write range invalid. Offset: 1786352, len: 32
W: 19 status write fails performing the swap
E: panic!

After power cycling the device and waiting for quite some time the following is displayed:

I: IS25LP032D: SFDP v 1.6 AP ff with 1 PH
I: PH0: ff00 rev 1.6: 16 DW @ 30
I: IS25LP032D: 4 MiBy flash
*** Booting Zephyr OS build v3.1.0-rc3-32-g801fe1fa06bd ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Scratch: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: primary slot
I: Swap type: none
E: Image in the primary slot is not valid!
E: Unable to find bootable image

This tells me that the swap actually took place and resulted in a bricked device...

Any ideas what is causing this?

Thx in advance,
Anders


build ROM library

Jacob Avraham
 

Hi,
I'm planning to build a couple of libraries that will reside in ROM, and call them from a Zephyr application.
The nature of these libraries is that I don't have control of their source code and their APIs, so calling them
indirectly using a function pointers table is not a route I'd like to go.
The ROM code could be some standard compression library, or maybe portions of commonly used libc functions, and it will not make calls to external code, like OS or other libraries.
 
The questions are:
1. Can I use Zephyr's build infrastructure to build a library (preferred ELF format) that does not contain the Zephyr OS and is not an application? I figure I'll probably need to relocate the data section of this library from ROM to RAM during boot.
2. How can I link a Zephyr application with this library so that all the calls will be resolved?

Thanks,
Jacob


Is there a Visual Studio Solution available for Zephyr?

Michael McDonnell <mmcdonnell@...>
 

Hi,

 

I would like to develop and debug using Visual Studio (not Visual Code) under Windows 10.

 

In other words, I would like to develop and debug with Visual Studio on the PC without the need of a board.

 

Is there a Visual Studio solution available for this?

 

Thanks!

 

Michael McDonnell | Senior Principal Firmware Architect
Marvell Semiconductor | 5488 Marvell Lane, Santa Clara, CA 95054
|Phone: +1.408.222.8072 Mobile +1.408-605-1864

 

M A R V E L L | www.marvell.com | mmcdonnell@...

 

 


Re: GSM modem AT commands

Gordon Klaus <gordon@...>
 

Thanks for your reply, Billy.  (I didn’t see it until now because I didn’t receive your response in my email; I had to check https://lists.zephyrproject.org/g/users/.  Odd, because I have received email responses from this list before.)

 

  • This seems to be something that would need to be included in the device driver rather than the PPP modem.

 

GSM_PPP is the device driver (https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/modem/gsm_ppp.c).  Confusingly, there is also a driver specifically for my modem (https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/modem/quectel-bg9x.c) but from what I understand, that is the old version.  In any case, neither one seems to provide any means for sending arbitrary AT commands from the application.

 

But now after browsing the code a bit more, I see that a different modem driver does provide more control, including sending arbitrary AT commands (although only for debug purposes): https://github.com/zephyrproject-rtos/zephyr/blob/main/include/zephyr/drivers/modem/hl7800.h  Perhaps something similar needs to be added to the gsm_ppp driver.

 

I’ll open an issue on GitHub to figure out where things should go.

 

 

From: Gordon Klaus
Sent: Thursday, May 12, 2022 15:04
To: users@...
Subject: GSM modem AT commands

 

Hello,

 

I have successfully made a network connection using MODEM_GSM_PPP.  Now, I would like to reduce power consumption by using power saving mode (PSM).  What is the recommended way to send the AT commands to achieve this?

 

Can I send AT commands to the UART device after gsm_ppp_start has been called?  How would I handle the response when the modem driver is already listening to that UART?  Is this what GSM_MUX is for?  I don’t see any documentation for how do use GSM mux.  Can I attach another UART mux to the device?  Can I pick an arbitrary unused DLCI?

 

I see that the modem driver has code to simplify handling AT responses, but this code is private to the driver.  Why is this code not available for general purpose AT command handling?  Is it planned to be made available?

 

Best regards,

Gordon


Re: Zephyr C++ support #CPP

Stephanos Ioannidis
 

Hi Dave,

 

> Is C++ exception support (reentrancy problems) now fixed?

 

Yes, C++ exceptions should be working for all supported architectures now when using the Zephyr SDK.

 

Regards,

 

Stephanos


Re: Zephyr C++ support #CPP

Dave Nadler
 

Is C++ exception support (reentrancy problems) now fixed?
Thanks!
Best Regards, Dave

On 5/16/2022 9:12 AM, Stephanos Ioannidis wrote:

Hi,

 

That documentation is outdated and will be updated in the 3.1 release.

 

Zephyr supports new and delete operators.

 

Regards,

 

Stephanos

 

From: users@... <users@...> On Behalf Of giatorta via lists.zephyrproject.org
Sent: Monday, May 16, 2022 8:18 PM
To: users@...
Subject: [Zephyr-users] Zephyr C++ support #CPP

 

Hi all,

I read here:
https://docs.zephyrproject.org/3.0.0/reference/kernel/other/cxx_support.html

that Zephyr supports C++ applications, but that the kernel does not support the new and delete operators, which looks quite restrictive to me (since the standard library itself uses those features)

Here however:
https://github.com/zephyrproject-rtos/zephyr/issues/31281
I read that STL is among the C++ "things that work" in Zephyr

I am missing something? My interest is in writing C++ applications over Zephyr, not drivers/kernel modules

thanks in advance!
Gianluca

--
Dave Nadler, USA East Coast voice (978) 263-0097, drn@..., Skype 
 Dave.Nadler1


Re: Zephyr C++ support #CPP

Stephanos Ioannidis
 

Hi,

 

That documentation is outdated and will be updated in the 3.1 release.

 

Zephyr supports new and delete operators.

 

Regards,

 

Stephanos

 

From: users@... <users@...> On Behalf Of giatorta via lists.zephyrproject.org
Sent: Monday, May 16, 2022 8:18 PM
To: users@...
Subject: [Zephyr-users] Zephyr C++ support #CPP

 

Hi all,

I read here:
https://docs.zephyrproject.org/3.0.0/reference/kernel/other/cxx_support.html

that Zephyr supports C++ applications, but that the kernel does not support the new and delete operators, which looks quite restrictive to me (since the standard library itself uses those features)

Here however:
https://github.com/zephyrproject-rtos/zephyr/issues/31281
I read that STL is among the C++ "things that work" in Zephyr

I am missing something? My interest is in writing C++ applications over Zephyr, not drivers/kernel modules

thanks in advance!
Gianluca


Zephyr C++ support #CPP

gianluca torta
 

Hi all,

I read here:
https://docs.zephyrproject.org/3.0.0/reference/kernel/other/cxx_support.html

that Zephyr supports C++ applications, but that the kernel does not support the new and delete operators, which looks quite restrictive to me (since the standard library itself uses those features)

Here however:
https://github.com/zephyrproject-rtos/zephyr/issues/31281
I read that STL is among the C++ "things that work" in Zephyr

I am missing something? My interest is in writing C++ applications over Zephyr, not drivers/kernel modules

thanks in advance!
Gianluca


Re: GSM modem AT commands

William Fish
 
Edited

Gordon,

This seems to be something that would need to be included in the device driver rather than the PPP modem. I see the issue being how a generic driver could provide device specific control?

You could use the AT+UPSV command but not all modems will support it.


Billy..


GSM modem AT commands

Gordon Klaus <gordon@...>
 

Hello,

 

I have successfully made a network connection using MODEM_GSM_PPP.  Now, I would like to reduce power consumption by using power saving mode (PSM).  What is the recommended way to send the AT commands to achieve this?

 

Can I send AT commands to the UART device after gsm_ppp_start has been called?  How would I handle the response when the modem driver is already listening to that UART?  Is this what GSM_MUX is for?  I don’t see any documentation for how do use GSM mux.  Can I attach another UART mux to the device?  Can I pick an arbitrary unused DLCI?

 

I see that the modem driver has code to simplify handling AT responses, but this code is private to the driver.  Why is this code not available for general purpose AT command handling?  Is it planned to be made available?

 

Best regards,

Gordon


Zephyr Developer Survey: Your Input Requested by Thursday, May 19

Brett Preston
 

(TSC Members/Alternates, Maintainers, Collaborators please follow link that were sent to you)


Members of the Zephyr Community,


We have assembled a Developer Survey to help us understand what is working well in the Zephyr Project, and what could be improved. The summary information will be shared with the TSC, and used to help the project figure out where to focus going forward. Responses are captured anonymously.


It would be very helpful to the project if you could take the time to share your thoughts in the survey at https://linuxfoundation.surveymonkey.com/r/25MM7CR. There are 35 questions, and we estimate it should probably take about 10 minutes to fill it in.


Responses are requested by end-of-day on Thursday, May 19.


If you have any questions, please don’t hesitate to reach out to one of us.


Thanks, 



Anas, Kate & Brett

--
Brett Preston
Sr. Program Manager
The Linux Foundation
+1 (971) 303-9030


Reminder to Register: Zephyr Developer Summit

Brett Preston
 

Members of the Zephyr Community,


The Zephyr Developer Summit is now less than a month away!


Have you completed your registration yet? https://events.linuxfoundation.org/zephyr-developer-summit/register/


All sessions will be streamed live for Virtual Attendees.


The Full Schedule is available at https://events.linuxfoundation.org/zephyr-developer-summit/program/schedule/


Session videos will be posted to YouTube post-event on a rolling cadence, but your best opportunity to experience the content, without delay, will be via In-Person or Virtual attendance.


For those newer to Zephyr, we’ve got events scheduled for Tuesday, June 7 – including a Hands-on Tutorial


For questions, please email events@...


We look forward to seeing you at the event!



Zephyr Project


Join us in Discord: https://chat.zephyrproject.org/ (Dev Summit channel - # zds2022)


--
Brett Preston
Sr. Program Manager
The Linux Foundation
+1 (971) 303-9030


Re: How to access the child nodes in a device tree (DTS) in Zephyr using DT_FOREACH_CHILD #dts #nrf52

unsunk.ship@...
 

The results from previous code were OK, I think it's a bug in the debugger. I posted the details here [^].
BR.


How to access the child nodes in a device tree (DTS) in Zephyr using DT_FOREACH_CHILD #dts #nrf52

unsunk.ship@...
 

Hi,
I originally posted this question to stackoverflow [^] so I think its better not to duplicate the whole story here.
Supposing I have a DTS file with a content like this one below:

n: detectors {
    compatible = "foo-detectors";
        
    // Definition of first channel
    det0: det_0 {
        irq-pins = <13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
        label = "Bar detector channel 1";
    };
    // Definition of second channel
    det1: det_1 {
        irq-pins = <17 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
        label = "Bar detector channel 2";
    };
};
And a structure like here below:
struct foo_detector_desc { 
    int irqpin; 
    int irqpin_flags;
}
How can I use macro DT_FOREACH_CHILD for populating an array with one item for each child of node detectors?

I tried this code below but, yet it compiled, the results where not what I wanted.

#define PIN_INFO_AND_COMMA(node_id) \
    { \
        .pin=DT_PROP_BY_IDX(node_id, irq_pins, 0),\
        .flags=DT_PROP_BY_IDX(node_id, irq_pins, 1),\
    },

const struct detector_data _det_data[] = {
    DT_FOREACH_CHILD(DT_NODELABEL(n), PIN_INFO_AND_COMMA)
};

BR.


Re: Scheduler/Thread Status #api

Andy Ross
 

Not public ones, no.  You can check kernel/include/ksched.h for the internal API for this.  I guess the immediate question has to be "what are you trying to do"?  Recognize that any decision made on the basis of this kind of stuff is going to be inherently racy without access to the scheduler's own synchronization (though on a single CPU device, just holding an interrupt lock is enough to be safe).

Also, just to clarify: k_sched_lock() doesn't mutate "scheduler" state at all, it's implemented via a trick that essentially elevates the current thread priority to a cooperative level, preventing preemption.

Andy


Scheduler/Thread Status #api

Casey Shea
 

Are there any API calls for retrieving thread and scheduler status?  I'm looking for something that would indicate the following:

  • Is the scheduler locked?
  • What is the thread status? (Ready, Waiting, Suspended)


Thanks!


Re: Implementation of Zephyr on custom board

Murphy, Lauren
 

Hi Bharath,

 

(1) I’ll look more into this and email you 1:1.

 

(2) Could you explain what you mean by “build the code without any board dependencies in West”? The module (if you’re using the module) can build for any board; see the Hello World sample. If you’re trying to use a custom board, you need definitions for the board + an overlay to make Zephyr aware of sensors you’re using.

 

Sincerely,

Lauren Murphy

 

From: users@... <users@...> On Behalf Of Bharath V
Sent: Wednesday, May 4, 2022 4:37 AM
To: users@...
Subject: [Zephyr-users] Implementation of Zephyr on custom board

 

Dear Team

 

I am currently working on implementing Zephyr RTOS with Tensorflow lite on a custom board (RISC-V based). I am facing the few issues such as

 

(i) Unable to avoid the use of standard C++ libraries.

(ii) Can we build the code without any board dependencies in west.

 

Kindly requesting for assistance.

 

Thanks and regards

Bharath V

161 - 180 of 3112