Use the drivers files from the custom application directory instead of ZEPHYR_BASE


Srinivasan Tamilarasan
 

Hi,

I am creating the standalone Zephyr application build.

 

I have moved the custom dts, soc and board files to the application directory by adding below below lines in application cmake file,

set(BOARD_ROOT ${CMAKE_CURRENT_LIST_DIR})

set(SOC_ROOT ${CMAKE_CURRENT_LIST_DIR})

set(DTS_ROOT ${CMAKE_CURRENT_LIST_DIR})

 

How to tell the zephyr to use the driver file from the my application directory instead of default location from ZEPHYR_BASE location?

 

Kindly help me to resolve this issue.

 

Regards,

Srinivasan


Jacob Avraham
 

Srinivasan,
I just did that recently.
I modeled my application and soc, board, dts and drivers as a standalone Zephyr module, and used example-application as a reference. Note the content of the zephyr/module.yml file, which points to the soc, dts, and boards location.
To build my application from the top of my repository, I set 2 environment variables:
ZEPHYR_BASE=<my_zephyr_directory>
ZEPHYR_EXTRA_MODULES=$PWD

and I run: west -b <my_board> <my_application_path>

No need to set  BOARD_ROOT, SOC_ROOT, DTS_ROOT.

Jacob Avraham




Srinivasan Tamilarasan
 

Hi Jacob,

Thank you for the response.

 

As you have mentioned, I have tried following items,

·       Removed  the statements set  BOARD_ROOT, SOC_ROOT, DTS_ROOT in cmake .

·       Added env variables, ZEPHYR_BASE=<my_zephyr_directory> and ZEPHYR_EXTRA_MODULES=$PWD.

·       Take reference to example-application and developed our custom application.

 

After that I am getting below error. PFA attachment of error log.

 

I have added CONFIG_CORTEX_M_SYSTICK=y in my board config file.

 

Can you please help me to resolve this issue?

 

Regards,

Srinivasan

 

From: devel@... <devel@...> On Behalf Of Jacob Avraham
Sent: 25 June 2021 06:00 PM
To: devel@...
Subject: Re: [Zephyr-devel] Use the drivers files from the custom application directory instead of ZEPHYR_BASE

 

[External Email]: This email arrived from an external source - Please exercise caution when opening any attachments or clicking on links.

Srinivasan,

I just did that recently.

I modeled my application and soc, board, dts and drivers as a standalone Zephyr module, and used example-application as a reference. Note the content of the zephyr/module.yml file, which points to the soc, dts, and boards location.

To build my application from the top of my repository, I set 2 environment variables:

ZEPHYR_BASE=<my_zephyr_directory>

ZEPHYR_EXTRA_MODULES=$PWD

 

and I run: west -b <my_board> <my_application_path>

 

No need to set  BOARD_ROOT, SOC_ROOT, DTS_ROOT.

 

Jacob Avraham


 

 


Jacob Avraham
 

Srinivasan,
From the logs it seems that you managed to pass the configuration phase and it looks that you are able to use your custom application repository properly with your own board, soc, and dts directories. So that's good news.
I'm not familiar with the ARM architecture implementation, but it looks like you are missing something related to the clock subsystem configuration, thus some code is not compiled in.
To debug, you can throw in the various Kconfig files comment lines like;
comment "comment from file foo section bar"
and see if it ends up in the final build/zephyr/.config file.

Good luck,
Jacob


--

Jacob Avraham | Principal SW Engineer

M: +972-52-6970067 | T: +972-9-8865314

E: jacob.avraham@...

Grand Netter building, Kfar Netter, Israel

Autotalks | www.auto-talks.com


Srinivasan Tamilarasan
 

Hi Jacob,

Thank you for the response. The issue got resolved now.

 

Regards,

Srinivasan

 

From: devel@... <devel@...> On Behalf Of Jacob Avraham
Sent: 26 June 2021 03:56 PM
To: devel@...
Subject: Re: [Zephyr-devel] Use the drivers files from the custom application directory instead of ZEPHYR_BASE

 

[External Email]: This email arrived from an external source - Please exercise caution when opening any attachments or clicking on links.

Srinivasan,

From the logs it seems that you managed to pass the configuration phase and it looks that you are able to use your custom application repository properly with your own board, soc, and dts directories. So that's good news.

I'm not familiar with the ARM architecture implementation, but it looks like you are missing something related to the clock subsystem configuration, thus some code is not compiled in.

To debug, you can throw in the various Kconfig files comment lines like;

comment "comment from file foo section bar"

and see if it ends up in the final build/zephyr/.config file.

 

Good luck,

Jacob


 

--

Jacob Avraham | Principal SW Engineer

M: +972-52-6970067 | T: +972-9-8865314

E: jacob.avraham@...

Grand Netter building, Kfar Netter, Israel

Autotalks | www.auto-talks.com