USIC initialization problems

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

cross mob
amanning
Level 4
Level 4
50 sign-ins 25 replies posted 10 questions asked

The XMC library USIC intialization functions (e.g XMC_I2C_CH_Init()) get the periphery out of reset by using registers in the SCU. These registers can only be accessed when in privileged mode. 

If Keil RTX is used in unpriviliged mode, it is not possible to intialize the periphery from within a task.  This makes the whole startup of the application very difficult especially when using C++. 

Is there anyway to start the tasks in priviliged mode and then changed to unpriviliged at the end of the intialization? What cammand are needed to change modes?

0 Likes
1 Solution
RValascho
Employee
Employee
5 sign-ins First like received 5 questions asked

This is an OS topic, so it may be better to get an official answer from Keil.  But my initial thought would be that if you can't initialize the USIC before OS initialization, a HW interrupt should temporarily force the priviliged mode.  That may be a workaround.  Generally this is how the OS itself would return to a priviliged mode.

View solution in original post

0 Likes
4 Replies
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @amanning,

Can you please let us know the which device are you exactly using? 

Regards,

Aashita

 

0 Likes
amanning
Level 4
Level 4
50 sign-ins 25 replies posted 10 questions asked

I am using the XMC4500 at the moment, but the problem is the same with the whole family.

0 Likes
RValascho
Employee
Employee
5 sign-ins First like received 5 questions asked

This is an OS topic, so it may be better to get an official answer from Keil.  But my initial thought would be that if you can't initialize the USIC before OS initialization, a HW interrupt should temporarily force the priviliged mode.  That may be a workaround.  Generally this is how the OS itself would return to a priviliged mode.

0 Likes
amanning
Level 4
Level 4
50 sign-ins 25 replies posted 10 questions asked

In a complex application, using device driver libraries and hardware abstraction layers it is not easy to implement either of your suggestions. It is not easy for a user of the XMC library to know which functions require priviliged mode, maybe this information should be added.