Date   

Re: Using the Cortex M4 on IMX7D

Michael Graichen
 

Am 26.02.21 um 18:06 schrieb Arnaud POULIQUEN:
Hi,

-----Original Message-----
From: Kumar Gala <kumar.gala@linaro.org>
Sent: vendredi 26 février 2021 17:27
To: Michael Graichen <michael.graichen@hotmail.com>
Cc: users@lists.zephyrproject.org; Arnaud POULIQUEN
<arnaud.pouliquen@st.com>
Subject: Re: [Zephyr-users] Using the Cortex M4 on IMX7D



On Feb 26, 2021, at 3:43 AM, Michael Graichen
<michael.graichen@hotmail.com> wrote:

Hey,

I have just started working on a IMX7D
(https://www.kontron.de/products/boards-and-standard-form-
factors/smarc/smarc-samx7.html) together with Zephyr I noticed that the
Colibri iMX7 Board has support for the Cortex M4.
So I've build an example by using:

cmake -GNinja -DBOARD=colibri_imx7d_m4 ../samples/basic/blinky

and tried to load that on the Cortex M4

echo -n zephyr.elf > /sys/class/remoteproc/remoteproc0/firmware
and
echo -n start > /sys/class/remoteproc/remoteproc0/state

Unfortunatly the start fails because the elf-file has no resource table.
I can select TOP ---> Additional libraries ---> [*] coprocessor
resource table within menuconfig but the resulting elf-file is still missing the
resource table.

What am i missing? How can a add a resource table to the elf-file?
The Linux remoteproc framework allows you to load a firmware without a resource table.
The resource table is useful only if you want to use the RPMsg protocol or a trace buffer.
So this should work, except if the IMX platform driver doesn't allow this....


best regards
Michael

I don’t believe the remoteproc loading was ever supported for the imx family
with zephyr. This is something you’d need to add support for. I think it might
be supported on the STM32 MP1 as an example. (I added Arnaud on CC as he
added the STM32 MP1 support).
Right, I think today only the stm32mp1 support the resource table in zephyr, but this should be enough generic to
be supported by another platform.
Anyway if you don't want to use RPMsg, probably better as a first step to understand why you
can not load a firmware without resource table.
Regards
Arnaud


For the i.mx I think you can load via u-boot and there’s a section in the zephyr
board docs here about it:

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

- k


Hey Arnaud,

Thanks for your reply.

I've seen that stm32_rproc driver has additionally functions within static const struct rproc_ops st_rproc_ops
https://elixir.bootlin.com/linux/v5.11.2/source/drivers/remoteproc/stm32_rproc.c#L544
especially

.parse_fw = stm32_rproc_parse_fw,

within the plain rproc driver

rproc->ops->parse_fw = rproc_elf_load_rsc_table

is registerd within "static int rproc_alloc_ops()"

https://elixir.bootlin.com/linux/v5.11.2/source/drivers/remoteproc/remoteproc_core.c#L2202

and is called by doing the "echo start" command.

https://elixir.bootlin.com/linux/v5.11.2/source/drivers/remoteproc/remoteproc_elf_loader.c#L359


but fails after the find_table() function.

so if i just skip that for a test in https://elixir.bootlin.com/linux/v5.11.2/source/drivers/remoteproc/remoteproc_core.c#L1464, does that take me over the point?
I can not see the code where rproc actually "loads" the firmware to the M4?

best regards and a great weekend
Michael


Re: Using the Cortex M4 on IMX7D

Michael Graichen
 

Am 27.02.21 um 09:32 schrieb Marco Cavallini:
Hi,
I tested Zephyr with a Colibri i.MX7 and it works our of the box.
west build -p auto -b colibri_imx7d_m4 samples/philosophers
afterwards I loaded and run the binary using u-boot
--
Marco Cavallini - KOAN  - Italy

Thanks you you reply.

guess I will test that next week.

What Memory addresses did you use when you tested the "out of the Box" example?

Have a great weekend
Michael


Re: Using the Cortex M4 on IMX7D

Michael Graichen
 

Am 26.02.21 um 17:27 schrieb Kumar Gala:

On Feb 26, 2021, at 3:43 AM, Michael Graichen <michael.graichen@hotmail.com> wrote:

Hey,

I have just started working on a IMX7D (https://www.kontron.de/products/boards-and-standard-form-factors/smarc/smarc-samx7.html) together with Zephyr
I noticed that the Colibri iMX7 Board has support for the Cortex M4.
So I've build an example by using:

cmake -GNinja -DBOARD=colibri_imx7d_m4 ../samples/basic/blinky

and tried to load that on the Cortex M4

echo -n zephyr.elf > /sys/class/remoteproc/remoteproc0/firmware
and
echo -n start > /sys/class/remoteproc/remoteproc0/state

Unfortunatly the start fails because the elf-file has no resource table.
I can select TOP ---> Additional libraries ---> [*] coprocessor resource table within menuconfig
but the resulting elf-file is still missing the resource table.

What am i missing? How can a add a resource table to the elf-file?

best regards
Michael
I don’t believe the remoteproc loading was ever supported for the imx family with zephyr. This is something you’d need to add support for. I think it might be supported on the STM32 MP1 as an example. (I added Arnaud on CC as he added the STM32 MP1 support).
For the i.mx I think you can load via u-boot and there’s a section in the zephyr board docs here about it:
https://docs.zephyrproject.org/latest/boards/arm/colibri_imx7d_m4/doc/index.html
- k
Thanks for your reply.

This link was the reason why I thought to give it a try. But I'm using barebox as a bootloader right now, so I thought to test "the Linux way" first. I guess I will test u-boot next week.

I have looked over the boot instruction from the link.
u-boot is using the plain .bin file for loading the M4 while remoteproc is using the .elf file.

Is it right that all those environment variables, especially 'setenv m4addr 0x007f800' that are set in u-boot before booting the M4 should come out of the resource table when using remoteproc?

Do you have more information about how a resource table for the IMX7-M4 should look like?



Have a great weekend.
Michael


Re: Using the Cortex M4 on IMX7D

Marco Cavallini
 

Hi,
I tested Zephyr with a Colibri i.MX7 and it works our of the box.

west build -p auto -b colibri_imx7d_m4 samples/philosophers

afterwards I loaded and run the binary using u-boot

--
Marco Cavallini - KOAN  - Italy


Re: Using the Cortex M4 on IMX7D

Arnaud POULIQUEN
 

Hi,

-----Original Message-----
From: Kumar Gala <kumar.gala@linaro.org>
Sent: vendredi 26 février 2021 17:27
To: Michael Graichen <michael.graichen@hotmail.com>
Cc: users@lists.zephyrproject.org; Arnaud POULIQUEN
<arnaud.pouliquen@st.com>
Subject: Re: [Zephyr-users] Using the Cortex M4 on IMX7D



On Feb 26, 2021, at 3:43 AM, Michael Graichen
<michael.graichen@hotmail.com> wrote:

Hey,

I have just started working on a IMX7D
(https://www.kontron.de/products/boards-and-standard-form-
factors/smarc/smarc-samx7.html) together with Zephyr I noticed that the
Colibri iMX7 Board has support for the Cortex M4.
So I've build an example by using:

cmake -GNinja -DBOARD=colibri_imx7d_m4 ../samples/basic/blinky

and tried to load that on the Cortex M4

echo -n zephyr.elf > /sys/class/remoteproc/remoteproc0/firmware
and
echo -n start > /sys/class/remoteproc/remoteproc0/state

Unfortunatly the start fails because the elf-file has no resource table.
I can select TOP ---> Additional libraries ---> [*] coprocessor
resource table within menuconfig but the resulting elf-file is still missing the
resource table.

What am i missing? How can a add a resource table to the elf-file?
The Linux remoteproc framework allows you to load a firmware without a resource table.
The resource table is useful only if you want to use the RPMsg protocol or a trace buffer.
So this should work, except if the IMX platform driver doesn't allow this....


best regards
Michael

I don’t believe the remoteproc loading was ever supported for the imx family
with zephyr. This is something you’d need to add support for. I think it might
be supported on the STM32 MP1 as an example. (I added Arnaud on CC as he
added the STM32 MP1 support).
Right, I think today only the stm32mp1 support the resource table in zephyr, but this should be enough generic to
be supported by another platform.
Anyway if you don't want to use RPMsg, probably better as a first step to understand why you
can not load a firmware without resource table.

Regards
Arnaud


For the i.mx I think you can load via u-boot and there’s a section in the zephyr
board docs here about it:

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

- k


Re: Using the Cortex M4 on IMX7D

Kumar Gala
 

On Feb 26, 2021, at 3:43 AM, Michael Graichen <michael.graichen@hotmail.com> wrote:

Hey,

I have just started working on a IMX7D (https://www.kontron.de/products/boards-and-standard-form-factors/smarc/smarc-samx7.html) together with Zephyr
I noticed that the Colibri iMX7 Board has support for the Cortex M4.
So I've build an example by using:

cmake -GNinja -DBOARD=colibri_imx7d_m4 ../samples/basic/blinky

and tried to load that on the Cortex M4

echo -n zephyr.elf > /sys/class/remoteproc/remoteproc0/firmware
and
echo -n start > /sys/class/remoteproc/remoteproc0/state

Unfortunatly the start fails because the elf-file has no resource table.
I can select TOP ---> Additional libraries ---> [*] coprocessor resource table within menuconfig
but the resulting elf-file is still missing the resource table.

What am i missing? How can a add a resource table to the elf-file?

best regards
Michael

I don’t believe the remoteproc loading was ever supported for the imx family with zephyr. This is something you’d need to add support for. I think it might be supported on the STM32 MP1 as an example. (I added Arnaud on CC as he added the STM32 MP1 support).

For the i.mx I think you can load via u-boot and there’s a section in the zephyr board docs here about it:

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

- k


Using the Cortex M4 on IMX7D

Michael Graichen
 

Hey,

I have just started working on a IMX7D (https://www.kontron.de/products/boards-and-standard-form-factors/smarc/smarc-samx7.html) together with Zephyr
I noticed that the Colibri iMX7 Board has support for the Cortex M4.
So I've build an example by using:

cmake -GNinja -DBOARD=colibri_imx7d_m4 ../samples/basic/blinky

and tried to load that on the Cortex M4

echo -n zephyr.elf > /sys/class/remoteproc/remoteproc0/firmware
and
echo -n start > /sys/class/remoteproc/remoteproc0/state

Unfortunatly the start fails because the elf-file has no resource table.
I can select TOP ---> Additional libraries ---> [*] coprocessor resource table within menuconfig
but the resulting elf-file is still missing the resource table.

What am i missing? How can a add a resource table to the elf-file?

best regards
Michael


Re: openocd.conf default

Bolivar, Marti
 

Hi there,

You can read through the 'west flash -H -r openocd' output to see
what options you have for overriding the default behavior, but
the short answer is no, most of this is determined by the board.cmake
file.

If a particular board.cmake file is not correct, please file a bug.

You are of course free to ignore the default openocd runner entirely and
just run openocd yourself if you have settings you prefer.

HTH,
Martí

Gunnar Bråding via lists.zephyrproject.org
<gunnar=astrogator.se@lists.zephyrproject.org> writes:

Hi!

I might have missed something, but is there a way to set a default openocd.conf in the local application directory, or set some other file as the default? The board-specific ones are not necessarily correct. I even wonder if the debug settings are board specific, rather than user-specific?
Actually I personally would consider it nice to just use my general configuration when selecting probe and such.

Cheers,
— Gunnar Brading


STM32L4 Low Power Management - Simple example?

@kiwironnie
 
Edited

New to Zephyr am trying to get a simple example working, leveraging the Zephyr low power architecture on a Nucleo STM32L433 development board.
This is very critical to our requirement.
There are functions in power.h / power.c in the STML4 soc directory to support entering low power states. But it's unclear what other code is needed and whether that has been implemented.
I enable power management in prj.conf and make such calls as the following taken from an example elsewhere for a different board/mcu:

        printk("Busy-wait %u s with UART off\n", BUSY_WAIT_S);
status = device_set_power_state(cons, DEVICE_PM_LOW_POWER_STATE, NULL,
NULL);
k_busy_wait(BUSY_WAIT_S * USEC_PER_SEC);
status = device_set_power_state(cons, DEVICE_PM_ACTIVE_STATE, NULL,
NULL);
However this doesn't work as the mcu doesn't enter low power mode when sleeping.
Perhaps something fundamental/critical that I've omitted.

Note that there is no problem using STM HAL commands directly to get into stop modes but that bypasses Zephyr's power management capability (https://docs.zephyrproject.org/latest/reference/power_management/index.html).

Suggestions would be very much appreciated.



openocd.conf default

Gunnar Bråding
 

Hi!

I might have missed something, but is there a way to set a default openocd.conf in the local application directory, or set some other file as the default? The board-specific ones are not necessarily correct. I even wonder if the debug settings are board specific, rather than user-specific?
Actually I personally would consider it nice to just use my general configuration when selecting probe and such.

Cheers,
— Gunnar Brading


How can I set the content type and content encoding of the MQTT message #mqtt

petrus.vanderwalt@...
 

Hi, I am sending messages to my Azure IoT hub.  I am also storing my messages in Azure blob storage.  My message gets sent in JSON format.  The IoT hub receives my message correctly but when stored to the blob my messages are converted to 64-base.  This is the default setting of the blob storage for the message.  I have to specify the content type as "application/json" and content encoding as "utf_8" when sending my messages from the device.  I can not seem to find a place in the Zephyr mqtt library to set these message settings.  Does anyone have an idea how I can include these settings with my messages?  I will share a snippet from C# code that I use to simulate devices to show how they achieve this.

Any help or suggestions would be highly appreciated.

Regards,
Jurgens


Re: Azure MQTT with GSM modem over PPP #mqtt #modem #ppp #nrf52840

petrus.vanderwalt@...
 

Hi Jukka,

Thank you for your assistance.  My MQTT client using GSM modem is now working.

Regards,
Jurgens 


Re: Problem with LPTIM on Zephyr

Raz <raziebe@...>
 

Will i be able to run interrupt routine in an app ? 

בתאריך יום ד׳, 17 בפבר׳ 2021, 13:13, מאת Erwan Gouriou ‏<erwan.gouriou@...>:

First it depends what you intend to do with LPTIM.
There is a LPTIM driver which is meant to be used as a low power kernel ticker 
instead of the Cortex systick.

You can enable it in any sample using CONFIG_STM32_LPTIM_TIMER=y
By default it will use LSE as clock source.


On Tue, 16 Feb 2021 at 16:25, Raz <raziebe@...> wrote:
I tried to compile LPTIM in the kernel but Zephyr fails. 
Is there an example for LPTIM in an app ?


On Tue, Feb 16, 2021 at 12:30 PM Erwan Gouriou <erwan.gouriou@...> wrote:
Hi Raz,


Did you checked that the clocks are correctly enabled?
In any case, I'd suggest to minimize the use of Cube functions to the timer related functions.
Zephyr provides most of things you need for MSP and board init.

Cheers
Erwan

On Fri, 12 Feb 2021 at 14:59, Raz <raziebe@...> wrote:
hello.
I am trying to use the LPTIM for the nucleos 476  by integrating it from CUBE. I ported the code below to Zephyr:

 HAL_Init();

  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_LPTIM1_Init();
  for (;i<2;i++) {
 HAL_GPIO_TogglePin (GPIOA, GPIO_PIN_5);
 HAL_Delay(1000);
  }
  /*
   * LSE Input freq is 32768 hz.
   *  32768/64 = 512hz
   * */
  int secs = 3;
  if (HAL_LPTIM_Counter_Start_IT(&hlptim1, 512* secs + 1) != HAL_OK) {
     Error_Handler();
  }
  HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
  while (1)
  {
 HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
  }
  /* USER C

However, the timer does not start. Anyone is familiar with this problem ?

Kind regards


SDK 0.12.3 Release

Kumar Gala
 

Hi,

Latest version of the SDK can be found here:

https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.12.3

Please download and try things out and report any issues.

* Backport GCC 10.2+ (ie, changes that would be in GCC 10.3) for Arm for fixes associated with Cortex-M55

- k


Timer with high Frequency

tobias.roehmel@...
 

Hi all,

I am using an STM32F4 discovery board which runs at 100Mhz. I want to fade an LED with PWM and need to change the PWM duty-cycle very quickly (every us). I tried using a k_timer but it's not updating the duty-cycle fast enough. I tried to increase the tick-rate (with CONFIG_SYS_CLOCK_TICKS_PER_SEC) but this didn't help. What would be the correct way to do this?

Kind regards,
Tobias Röhmel


LTS schedule and scope meeting on Tuesday, 23rd February

Carles Cufi
 

Hi all,

As you probably know, on Tuesdays we have two regularly scheduled meetings:

- API meeting (17:00 UTC)
- Bug triage and Release Readiness meeting (18:00 UTC)

This week however, we will hold a special one-off meeting to discuss the schedule and scope of the next LTS release.
The meeting will be open to everyone and will last two hours.

When: Tuesday, 23rd February, 17:00 UTC (18:00 CET, 12PM EST, 11AM CST, 9AM PST)
Where: https://teams.microsoft.com/l/meetup-join/19%3ameeting_NWU2MjZlYWEtZDcwMi00MWQzLTgwMjEtNDdkYjQwMjBjMmFj%40thread.v2/0?context=%7b%22Tid%22%3a%22af0096d9-700c-411a-b795-b3dd7122bad2%22%2c%22Oid%22%3a%22841a7c92-7816-4faf-9887-5e334e88f6d8%22%7d

Thanks,

Carles


Re: Problem with LPTIM on Zephyr

Erwan Gouriou
 

First it depends what you intend to do with LPTIM.
There is a LPTIM driver which is meant to be used as a low power kernel ticker 
instead of the Cortex systick.

You can enable it in any sample using CONFIG_STM32_LPTIM_TIMER=y
By default it will use LSE as clock source.


On Tue, 16 Feb 2021 at 16:25, Raz <raziebe@...> wrote:
I tried to compile LPTIM in the kernel but Zephyr fails. 
Is there an example for LPTIM in an app ?


On Tue, Feb 16, 2021 at 12:30 PM Erwan Gouriou <erwan.gouriou@...> wrote:
Hi Raz,


Did you checked that the clocks are correctly enabled?
In any case, I'd suggest to minimize the use of Cube functions to the timer related functions.
Zephyr provides most of things you need for MSP and board init.

Cheers
Erwan

On Fri, 12 Feb 2021 at 14:59, Raz <raziebe@...> wrote:
hello.
I am trying to use the LPTIM for the nucleos 476  by integrating it from CUBE. I ported the code below to Zephyr:

 HAL_Init();

  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_LPTIM1_Init();
  for (;i<2;i++) {
 HAL_GPIO_TogglePin (GPIOA, GPIO_PIN_5);
 HAL_Delay(1000);
  }
  /*
   * LSE Input freq is 32768 hz.
   *  32768/64 = 512hz
   * */
  int secs = 3;
  if (HAL_LPTIM_Counter_Start_IT(&hlptim1, 512* secs + 1) != HAL_OK) {
     Error_Handler();
  }
  HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
  while (1)
  {
 HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
  }
  /* USER C

However, the timer does not start. Anyone is familiar with this problem ?

Kind regards


Re: STM32L Errors Building samples/drivers/spi_fujitsu_fram with Ninja

@kiwironnie
 

Thanks Erwan, brilliant, solved!

When the board alias "spi-1 = &spi1;" was added the executable built ok, no errors!

Note that an underscore in "spi_1 = &spi1;" threw an error: dtlib.DTError: /aliases: alias property name 'spi_1' should include only characters from [0-9a-z-]

But then it's clear from the documentation that dashes in the .dts become underscores in the source.

Am not bothered about the actual hardware at this stage, as the idea is to be able to use an example that builds ok as a template to be modified.

Cheers

Ron


Re: Problem with LPTIM on Zephyr

Raz <raziebe@...>
 

I tried to compile LPTIM in the kernel but Zephyr fails. 
Is there an example for LPTIM in an app ?


On Tue, Feb 16, 2021 at 12:30 PM Erwan Gouriou <erwan.gouriou@...> wrote:
Hi Raz,


Did you checked that the clocks are correctly enabled?
In any case, I'd suggest to minimize the use of Cube functions to the timer related functions.
Zephyr provides most of things you need for MSP and board init.

Cheers
Erwan

On Fri, 12 Feb 2021 at 14:59, Raz <raziebe@...> wrote:
hello.
I am trying to use the LPTIM for the nucleos 476  by integrating it from CUBE. I ported the code below to Zephyr:

 HAL_Init();

  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_LPTIM1_Init();
  for (;i<2;i++) {
 HAL_GPIO_TogglePin (GPIOA, GPIO_PIN_5);
 HAL_Delay(1000);
  }
  /*
   * LSE Input freq is 32768 hz.
   *  32768/64 = 512hz
   * */
  int secs = 3;
  if (HAL_LPTIM_Counter_Start_IT(&hlptim1, 512* secs + 1) != HAL_OK) {
     Error_Handler();
  }
  HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
  while (1)
  {
 HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
  }
  /* USER C

However, the timer does not start. Anyone is familiar with this problem ?

Kind regards


Re: Port for STM32F101RF #stm32

Erwan Gouriou
 

Hi Thomas,

There is no STM32F101 port indeed.
Though there are others variants of STM32F1 series available.
So I don't expect too much trouble when adding STM32F101 support.

You could find below a recent example of STM32 SoC porting:

Cheers
Erwan

On Tue, 16 Feb 2021 at 14:59, <arve@...> wrote:
Ciao a tutti

At the moment I am busy with a project which was built on a rather old STM32F101RF. Is there a Zephyr port available for it? I could not find anything in the sources. But I may have overlooked something.

Many thanks in advance
Thomas

241 - 260 of 2702