Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Sachin_Patel
Level 3
Level 3
25 sign-ins 10 questions asked 10 replies posted

Hi,

Currently, I am using modustool box for my development. I used to generate code using the device configuration tool. But it generate code default using the PDL library.

I want to generate code using the HAL library. Is there any way to generate code using HAL?

0 Likes
1 Solution
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @Sachin_Patel ,

The HAL library is an abstraction layer above the PDL library.

AlenAn14_0-1662363689206.png

 

Device configurator does not generate the PDL library, but instead only the configuration structures for the peripherals that you have to use with the PDL API's to initialize and use your hardware peripherals.

The HAL is a library that lies above the PDL ( meaning, underneath, it uses the PDL API's). This library makes it easier for you to use the HAL API's for a peripheral without having to use the device configurator as the API's do this for you. A negative side to this is that you lose granular control of your peripheral, as the HAL API's may use default configuration which you may not need in your application whereas PDL API's give you full control of the peripheral, but you have to understand and configure each parameter in device configurator.

Please refer this thread for more details as well : link

Also please have a look at section 2.6.1.1 of the ModusToolbox user guide for more details regarding the HAL library.

Warm Regards
Alen

View solution in original post

4 Replies
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @Sachin_Patel ,

The HAL library is an abstraction layer above the PDL library.

AlenAn14_0-1662363689206.png

 

Device configurator does not generate the PDL library, but instead only the configuration structures for the peripherals that you have to use with the PDL API's to initialize and use your hardware peripherals.

The HAL is a library that lies above the PDL ( meaning, underneath, it uses the PDL API's). This library makes it easier for you to use the HAL API's for a peripheral without having to use the device configurator as the API's do this for you. A negative side to this is that you lose granular control of your peripheral, as the HAL API's may use default configuration which you may not need in your application whereas PDL API's give you full control of the peripheral, but you have to understand and configure each parameter in device configurator.

Please refer this thread for more details as well : link

Also please have a look at section 2.6.1.1 of the ModusToolbox user guide for more details regarding the HAL library.

Warm Regards
Alen

Sachin_Patel
Level 3
Level 3
25 sign-ins 10 questions asked 10 replies posted

Thanks, @AlenAn14  for your response.

Is there any way to generate a configuration structure that can I use using HAL API's?

0 Likes

Hi @Sachin_Patel ,

Unfortunately there is no tool that does this and hence you will have to manually create the configuration structures for use with HAL API's.
The Device Configurator tool only generates configuration structures for use with PDL API's.

Warm Regards
Alen

Sachin_Patel
Level 3
Level 3
25 sign-ins 10 questions asked 10 replies posted

Thanks, @AlenAn14 .

0 Likes