2022-06-28 05:30 AM
2022-06-28 05:32 AM
I checked the datasheet and manual but nothing obvious to pin point the cause, is this bug in MXCube or something missed?
2022-06-28 05:46 AM
Just tried Nucleo-L476RG == STM32L476RGTx and it let me define ADC1_IN5/ADC1_IN6 as SingleEnded on PA0/PA1 when I had already defined USART2_TX/Rx on PA2/PA3.
Maybe you have other settings?
Consider starting with a blank STM32L476RGTx (don't use board selector) so you know everything that is defined. Then do a compare with the Nucleo-L476RG project (compare ioc file or compare generated reports txt+pdf) to see the differences.
Using STM32CubeMX 6.5.0
Paul
2022-06-28 05:47 AM
(Try: Exit and restart MX, don't open existing file - maybe something got corrupted. Has MX been operating properly before this project?)
2022-06-28 06:39 AM
Thank for the quick answer, Paul.
Yes it was operating fine (RTC,ADC-DMA,GPIO under HAL, I just learning about HAL/LL library (via this practice from TI/NXP library) until the MXCube bug was found. I solved this by copying the MX_ADC1_Init to other user project folders (to avoid overwriting by MXCube update) and added code manually including LL GPIO edit PA0/PA1 to analogue and install rank channels and it worked fine. Whatever bug in MXCube, I have no time to fiddle. I found a way to implement LL library into the user project folder (which MXCube has no access to remove it). Wondered why STM so keen to avoid this!! (lol).
Hmmm...I will check later Nucleo-L476RG == STM32L476RGTx, where did this comes from?
It has been 2-week learning curve with STM32, mostly evening. I have a lot of experience in TI and NXP.
2022-06-28 07:53 AM
If in STM32CubeMX you run the board selector then it offers
Nucleo-L476RG which has STM32L476RGTx, as you didn't mention exact part number of your Nucleo then that is what I tried.
I suggest you put all your own code in a custom folder, not in /core. We use /ProjectCode, and we also have main() immediately call main2() which allows us to have a custom main without worry that a future MX Generate would overwrite anything.
Take care with any modifications you do to generated files or library files. I suggest:
1) Copy the mods to a text file under /ProjectCode so if they are overwritten they are easy to recover
2) Create a document with screen captures of all the MX and IDE settings you ever modify, so if you ever have to recreate project from scratch, or create a similar project, you can see exactly what was needed (great for students and following employees as well).
3) Try not to modify Generated or library files, instead copy them, and use "Resource Configurations > Exclude from Built" to omit the original, or "adjust order of include folders" to give priority to your folders over generated/library folders.
Doing this will make life easier when you upgrade MX/IDE/Libs/etc. Leaving it for later will make it infinitely likely it'll never get done, or won't be properly remembered what was done whenever it is gotten to. Just speaking from my own team's experience.
Paul