In which STM32CubeIDE project file are the USB OTG interrupt priority values?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-06-23 3:25 AM
Hi, I'm testing the priorities of the modules, and I would like to know in which file the "Device Configuration Tool Code Generator" saved the NVIC definitions.
I have a lot of code outside the delimiters, I can't use the "Device Configuration Tool Code Generator", so I need to know which file is saved, and change manually.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-06-23 1:26 PM
A distinction must be made between
- the configuration file IOC, which describes the current basic configuration
- the generated programme framework, in which one places one's own code between the USER CODE BEGIN - USER CODE END markers
The IOC uses STM32CubeMX as the starting point for programme generation. The IOC is also used for later programme generation after a possible change in the configuration (further peripherals or pins to be used, etc.), whereby the own code parts between the above markers are retained (as long as the respective peripherals are not removed).
The NVIC priority is now stored in the IOC at the mentioned location for later programme generation. In the generated source code, however, the priority stored in the IOC is also inserted, e.g. in USB_HOST\Target\usbh_conf.c, depending on the USB function selected using e.g.
HAL_NVIC_SetPriority(OTG_FS_IRQn, xxx, 0);
I hope I understood your question correctly and could help you with it?
Regards
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-06-23 3:41 AM
The NVIC definitions are stored in the IOC file, which is a text file, but you have to be very careful when modifying it so as not to destroy the structure. Since it is not intended for manual modification, there is also little documentation on the internal structure.
However, you will find the IRQ priority under NVIC.OTG_FS_IRQn.
Hope that helps?
Regards
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-06-23 10:31 AM
Thanks,
If the intention is not to be handled manually, how can I add delimiters in the code for the automatic generator to preserve my code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-06-23 10:37 AM
This is the last place I would look, I thought this file was read only by "Device Configuration Tool Code Generator"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-06-23 10:45 AM
I closed the project, removed the *.ioc file and performed project cleanup, but it compiled with no errors. So there must be another file that has this priority data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-06-23 10:47 AM
Or is it not possible to change the priority and the "Device Configuration Tool Code Generator" shows this option just for decoration?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-06-23 1:26 PM
A distinction must be made between
- the configuration file IOC, which describes the current basic configuration
- the generated programme framework, in which one places one's own code between the USER CODE BEGIN - USER CODE END markers
The IOC uses STM32CubeMX as the starting point for programme generation. The IOC is also used for later programme generation after a possible change in the configuration (further peripherals or pins to be used, etc.), whereby the own code parts between the above markers are retained (as long as the respective peripherals are not removed).
The NVIC priority is now stored in the IOC at the mentioned location for later programme generation. In the generated source code, however, the priority stored in the IOC is also inserted, e.g. in USB_HOST\Target\usbh_conf.c, depending on the USB function selected using e.g.
HAL_NVIC_SetPriority(OTG_FS_IRQn, xxx, 0);
I hope I understood your question correctly and could help you with it?
Regards
/Peter
