Date   

Re: Example code showing setup of SPI

Carles Cufi
 

+ Andrzej

On 16/10/2018, 23:26, "users@... on behalf of Ormund Williams" <users@... on behalf of ormundw@...> wrote:

Hi All,

I was looking for some example code showing how to use SPI on an
nRF52840-DK board, especially selecting the pins that will be used.

Regards.

__
Ormund


Re: #customboard #defconfig #supervisormode #customboard #defconfig #supervisormode

Mani Sadhasivam
 

It seems to be the case that this collides with some RISC-V specific term?

That's right! In RISC-V terms, Machine mode has access to all system resources and is the
mandatory mode to implement. Supervisor mode has a different usage model, which I guess
used for virtualization. 


Re: #customboard #defconfig #supervisormode #customboard #defconfig #supervisormode

Sathya Narayanan N <sathya281@...>
 

Thanks. Actually I want to remove any supervisor mode access in the code. We don't want to have mmu. We want to run in user/machine mode.

I got your point on usermode. Is there a way I can turn off mmu/ supervisor mode. And run in machine mode.

The riscv32 hardware, we are running doesn't support mmu or supervisor mode. We want to run zephyr on it. I am looking for some flag kind of thing, that can turn off mmu/supervisor mode.

Please suggest.


On Thursday, October 18, 2018, Boie, Andrew P <andrew.p.boie@...> wrote:
> Hi,
>
>  
>
> User mode is currently only supported on x86, ARM, and ARC CPUs.
>
> The documentation uses "supervisor mode" to refer to non-user mode, i.e. all CPU instructions may be executed and all memory may be touched.
>
> It seems to be the case that this collides with some RISC-V specific term?
>
>  
>
> More information: https://docs.zephyrproject.org/latest/kernel/usermode/usermode.html
>
>  
>
> HTH,
>
> Andrew
>
>  
>
> From: users@... [mailto:users@...] On Behalf Of Mani Sadhasivam
> Sent: Wednesday, October 17, 2018 3:00 AM
> To: users@...
> Subject: Re: [Zephyr-users] #customboard #defconfig #supervisormode
>
>  
>
> Zephyr supports supervisor mode. I want to nullify it at software level.
>
> Where did you find this information? For RISC-V SoCs, the supervisor mode is only used
> when the base architecture has the 'S' extension. Since there is no Supervisor enabled
> SoCs supported by Zephyr so far, the core RISC-V code doesn't care about it.
>
> This applies to QEMU also.
>
> -Mani
>
--
 regards,
Sathya  

 


RNG and cross architecture

Carlos Miguens
 

Hi Devs!

  Compiling a Zephyr project with target nrf52_pca10040 the sys_rand32_get() works well. But when the target is FRDM-KL25Z the compiler show this error:
  • undefined reference to `sys_rand32_get'
 Is this because the KL25Z don't have a Random Number Generator?

 BTW... the file soc/arm/nxp_kinetis/kl2x/soc.h has an include to random/rand32.h Could please somebody tell me about sys_rand32_get for KL25Z target? 

Thanks!

Bests,
Carlos. 


Re: #customboard #defconfig #supervisormode #customboard #defconfig #supervisormode

Boie, Andrew P
 

Hi,

 

User mode is currently only supported on x86, ARM, and ARC CPUs.

The documentation uses "supervisor mode" to refer to non-user mode, i.e. all CPU instructions may be executed and all memory may be touched.

It seems to be the case that this collides with some RISC-V specific term?

 

More information: https://docs.zephyrproject.org/latest/kernel/usermode/usermode.html

 

HTH,

Andrew

 

From: users@... [mailto:users@...] On Behalf Of Mani Sadhasivam
Sent: Wednesday, October 17, 2018 3:00 AM
To: users@...
Subject: Re: [Zephyr-users] #customboard #defconfig #supervisormode

 

Zephyr supports supervisor mode. I want to nullify it at software level.

Where did you find this information? For RISC-V SoCs, the supervisor mode is only used
when the base architecture has the 'S' extension. Since there is no Supervisor enabled
SoCs supported by Zephyr so far, the core RISC-V code doesn't care about it.

This applies to QEMU also.

-Mani


Re: Example code showing setup of SPI

Ormund Williams
 

On Tue, 2018-10-16 at 23:52 -0700, filip.kubicz@... wrote:
Hello Ormund,
For example of using SPI you can take a look at
tests/drivers/spi/spi_loopback. Config for nRF52840 DK is at
tests/drivers/spi/spi_loopback/boards/nrf52840_pca10056.conf, also
please take a look at
boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts for pin
configuration.
Thanks Filip,

I'm just starting to learn Zephyr and looked thru all the examples but
never thought to look in test.

Thanks again.

__
Ormund


Re: #customboard #defconfig #supervisormode #customboard #defconfig #supervisormode

Mani Sadhasivam
 

Zephyr supports supervisor mode. I want to nullify it at software level.
Where did you find this information? For RISC-V SoCs, the supervisor mode is only used
when the base architecture has the 'S' extension. Since there is no Supervisor enabled
SoCs supported by Zephyr so far, the core RISC-V code doesn't care about it.

This applies to QEMU also.

-Mani


Re: #customboard #defconfig #supervisormode #customboard #defconfig #supervisormode

sathya281@...
 

Hi 

Zephyr supports supervisor mode. I want to nullify it at software level.

corresponding dts , we are using is "riscv32-qemu.dtsi"

regards,
sathya


On Wed, Oct 17, 2018 at 1:11 PM Mani Sadhasivam <manivannanece23@...> wrote:
Hi Sathya,

I am trying it for riscv32 architecture. We dont want to run in supervisor mode

Which SoC are you trying with? AFAIK all supported SoC's only incorporate Machine mode
access, not even User mode. Supervisor mode is meant for a full-fledged operating system.

Thanks,
Mani
 
 



--
 regards,
Sathya  

 


Re: #customboard #defconfig #supervisormode #customboard #defconfig #supervisormode

Mani Sadhasivam
 

Hi Sathya,

I am trying it for riscv32 architecture. We dont want to run in supervisor mode

Which SoC are you trying with? AFAIK all supported SoC's only incorporate Machine mode
access, not even User mode. Supervisor mode is meant for a full-fledged operating system.

Thanks,
Mani
 
 


Re: Example code showing setup of SPI

filip.kubicz@...
 

Hello Ormund,

For example of using SPI you can take a look at tests/drivers/spi/spi_loopback. Config for nRF52840 DK is at tests/drivers/spi/spi_loopback/boards/nrf52840_pca10056.conf, also please take a look at boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts for pin configuration.

Regards, Filip


#customboard #defconfig #supervisormode #customboard #defconfig #supervisormode

sathya281@...
 

Hi,

Is there a way to run zephyr only in user/machine mode ?

I am trying it for riscv32 architecture. We dont want to run in supervisor mode.

Please let me know

note: I am new to zephyr os.
regards,
sathya


Example code showing setup of SPI

Ormund Williams
 

Hi All,

I was looking for some example code showing how to use SPI on an
nRF52840-DK board, especially selecting the pins that will be used.

Regards.

__
Ormund


Re: Unable to test bluetooth using QEMU

Marco Tozzini
 

Hi Johan,

I don't have a Bluetooth adapter on my machine and "hciconfig" does not show any device available.

Thanks,
Marco


On October 15, 2018 10:28:41 PM PDT, Johan Hedberg <johan.hedberg@...> wrote:
Hi Marco,

On Mon, Oct 15, 2018, Marco Tozzini wrote:
On terminal windows #2 "sudo /home/marco/bluez/tools/btproxy -u -i 0"
output:
Listening on /tmp/bt-server-bredr
Opening user channel for hci0
Failed to bind Bluetooth socket: No such device

Any idea why I'm getting that error?

Does your PC have a Bluetooth adapter? Does e.g. running "hciconfig"
show hci0 for you?

Johan

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.


#ble [Question] zephyr BLE #ble

Seungwoo Woo
 

Hi 
This is seungwoo

We will contact you regarding the development of BLE.

I am trying to develop a device using nrf52810.

I want to transfer files via BLE using the file transfer method used in Android-nRF-Toolbox.

example ) 
Android-nRF-Tool(application) -> send file(OTA update file) -> my device(nrf52810) -> uart -> AP

Simply put, I want to transfer files.

Is this scenario possible?
 
Do you have any reference material?

Thansk you


Re: Unable to test bluetooth using QEMU

Johan Hedberg
 

Hi Marco,

On Mon, Oct 15, 2018, Marco Tozzini wrote:
On terminal windows #2 "sudo /home/marco/bluez/tools/btproxy -u -i 0"
output:
Listening on /tmp/bt-server-bredr
Opening user channel for hci0
Failed to bind Bluetooth socket: No such device

Any idea why I'm getting that error?
Does your PC have a Bluetooth adapter? Does e.g. running "hciconfig"
show hci0 for you?

Johan


Unable to test bluetooth using QEMU

Marco Tozzini
 

Hi,

I'm experimenting with Zephyr and BLE
I have few Nordic Semi boards and I've been able to successfully compile and run BLE examples for those.

I also would like to use QEMU to test BLE examples but I'm not successful

I'm following the instruction listed here
https://docs.zephyrproject.org/latest/subsystems/bluetooth/devel.html

On terminal windows #1 "ninja run" output:
[0/1] To exit from QEMU enter: 'CTRL+a, x'[QEMU] CPU: qemu32,+nx,+pae
qemu-system-i386: warning: Unknown firmware file in legacy mode: genroms/multiboot.bin
***** Booting Zephyr OS zephyr-v1.13.0-175-g62d7a7a5a *****
Starting Beacon Demo

On terminal windows #2 "sudo /home/marco/bluez/tools/btproxy -u -i 0" output:
Listening on /tmp/bt-server-bredr
Opening user channel for hci0
Failed to bind Bluetooth socket: No such device

Any idea why I'm getting that error?

Thanks,
Marco


Re: How to add post build step after linking zephyr.hexhe

Marti Bolivar <marti@...>
 

Hi, Sebastian,

Thanks for the useful information. This is something I've been wondering about as well.

On Mon, Oct 15, 2018 at 8:54 AM Bøe, Sebastian <Sebastian.Boe@...> wrote:
but this will only have pwd run after the first link, if your platform uses multi-pass linking, and you want to run pwd after the final link, you are going to need an upstream change to have the build system give you the name of the final link target.

 If I understand you correctly, I think this would be an extremely welcome change.

For example, I have often wanted to set up a post-build target to build a signed binary for MCUboot, which I believe can only be done to the binary produced by the final link (the signature is of a hash of the final binary, so IIUC any last-minute changes done to it by the final link would require a new signature).

Would it be possible to introduce this upstream?

Thanks,
Marti


Re: Add custom target to flash images signed for use with mcuboot

Thiago Silveira
 

Hi Phil,

Here's what we are using in our project (using nRF52832):

add_custom_target(load0)
add_custom_command(TARGET load0
        COMMAND ../../../mcuboot/scripts/imgtool.py ARGS 
        sign 
        --key ../root-rsa-2048.pem
        --header-size 0x200
        --slot-size 0x32000
       --align 8
       --version 1.2
       zephyr/zephyr.bin
       signed-zephyr.bin)

add_custom_command(TARGET load0
        COMMAND /opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-objcopy ARGS
        -I binary -O ihex signed-zephyr.bin signed-zephyr.hex --change-addresses 0xc000)

add_custom_command(TARGET load0
        COMMAND nrfjprog ARGS --erasepage 0xc000-0x3e000  -f nrf52
        COMMAND nrfjprog ARGS --program signed-zephyr.hex -f nrf52
        COMMAND nrfjprog ARGS --reset -f nrf52
)

With this setup, we need to run "make all load0" (build and then flash into slot 0). If you're using another board you will need to adjust the flashing procedure. Note that the mcuboot path is hard-coded relative to the project path. You should probably change that.

If you're currently using Zephyr's "make flash", you can read your board's "board.cmake" file to understand how it flashes. Example: zephyr/boards/arm/nrf52_pca10040/board.cmake

Cheers,
Thiago

Em seg, 15 de out de 2018 às 11:15, Phil Hipp <finke@...> escreveu:

Hi everybody,

I want to add a custom target in my application's CMakeLists.txt that can be used to flash my zephyr image signed for use with mcuboot (let's call it signed.hex). I'm pretty sure this can be achieved with add_custom_target, but I don't know the correct command to flash signed.hex from my build directory.


Re: How to add post build step after linking zephyr.hexhe

Bøe, Sebastian <Sebastian.Boe@...>
 

Hi,

so,

add_custom_command(TARGET app
POST_BUILD
COMMAND
pwd
)

doesn't work because you want to run the command after the elf target is finished, not the app.

So you want to do;

add_custom_command(TARGET zephyr_prebuilt
POST_BUILD
COMMAND
pwd
)

instead. zephyr_prebuilt is the target for the first linker pass of the elf file.

But zephyr_prebuilt can not be modified from outside of zephyr/CMakeLists.txt. To get around this we could either
possibly move zephyr_prebuilt into the application's scope.

Or avoid modifying zephyr_prebuilt. To avoid modifying zephyr_prebuilt
we could define a new target and command that depends on the elf file.
Something like this;

add_custom_command(
OUTPUT log.txt
COMMAND pwd
DEPENDS zephyr_prebuilt
)
add_custom_target(
log_txt
DEPENDS
log.txt
)

but this will only have pwd run after the first link, if your platform uses multi-pass linking, and you want to run pwd after the final link, you are going to need an upstream change to have the build system give you the name of the final link target.

This new target can be invoked by doing
"ninja log_txt", or by adding log_txt to the 'ALL' target so it is run on
"ninja".

https://github.com/SebastianBoe/zephyr/commit/313f23b7197237163cf7c7d4864bfae86fecbe39

________________________________________
From: Cufi, Carles
Sent: Monday, October 15, 2018 3:52:22 PM
To: Phil Hipp; users@...; Bøe, Sebastian
Subject: RE: [Zephyr-users] How to add post build step after linking zephyr.hexhe

+ Sebastian

From: users@... <users@...> On Behalf Of Phil Hipp
Sent: 15 October 2018 15:48
To: users@...
Subject: [Zephyr-users] How to add post build step after linking zephyr.hexhe

Hi everybody,

I'm currently trying to perform a post build step after the complete zephyr image has been linked. I tried to add following lines at the bottom of my application's CMakeLists.txt (I used pwd just for testing; will be replaced with the correct command later):



add_custom_command(TARGET app

POST_BUILD

COMMAND
pwd)

With these lines the command pwd will be called after linking libapp.a which is to early for my purpose. I need to run the command after the complete zephyr image has been linked to zephyr.*. How could I do that?


Add custom target to flash images signed for use with mcuboot

Phil Hipp
 

Hi everybody,

I want to add a custom target in my application's CMakeLists.txt that can be used to flash my zephyr image signed for use with mcuboot (let's call it signed.hex). I'm pretty sure this can be achieved with add_custom_target, but I don't know the correct command to flash signed.hex from my build directory.

1881 - 1900 of 3028