-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New Variant] STM32WB55VGY #2653
Comments
I think I was able to answer everything myself, using the existing information on the wiki. |
I've tried to add support for the STM32WB55VGYx MCUs, generating the ldscript and using a custom clock. I don't believe it's correct but it does compile, but my arduino sketch (Blink.ino) with a GPIO for an LED isn't behaving appropriately. In my ldscript.ld I've modified the memory area like this
and for the SystemClock, I've imported it from cube, according to all the peripherals I intended to use. |
Hi @federicaventriglia |
Hi @fpistm I've used the same clock config in Cube IDE and it seems to work, I used a simple LED Blink example but it seemed to run. |
One issue in the - FLASH (rx) : ORIGIN = 0x08000000, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
+ FLASH (rx) : ORIGIN = 0x08000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET In the generic clock, pay attention to the lock ressource management, see other WB variant:
As said if you try to debug, you will see if you end in an |
Thanks for catching the issue in the ldscript, I've modified it now:
As for the Clock config, I have also tried adding the lock/unlock, as you said I've noticed it from the P-NUCLEO implementation and I see the same behaviour. Not sure if I've used it properly but I'll attach the code as well. (I've also tried removing the custom clock configuration and using the default one (leaving the systemclock_config method empty) and I still see the same issue happening, which is strange) Custom Clock with Locks
I'm not too familiar with the debugging process so forgive me I'm not doing it properly. I've added some error statements in the Error_Handler() calls, would that work? Edit: I've replaced |
Seems like the same thing is happening with default clock config. I've also tried modifying the ldscript to
No changes |
Should be 0x20000004 not 0x20000008 with -4. |
Yeah, apologies for the typo, looks like this
|
Do you think the problem is in the clock configuration? Running the default one could also not work? |
Fixes stm32duino#2653. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Fixes stm32duino#2653. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
@federicaventriglia Some notes:
To redefine it to the proper value, create a |
Fixes stm32duino#2653. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Thank you. One question about the clock configuration, could you explain why there's this part?
my CubeMX generated file didn't have it and I wonder what it does. Also, the Flash and Ram sizes in the board_entry.txt file were wrong in the template; that could also be the issue. |
Welcome, let me know if the blink works.
IIRW, this is for the lowpower part and notmanaged by CubeMX.
No, it provides the full size but depending of the linker script, it have to be updated in the boards.txt when added. |
It did work once, but I have managed to put my PCB into a bad state, possibly causing a short after the first upload was successful, so I'll have to investigate why that was. |
OK. Let me know and I will merge the PR. |
@fpistm can you confirm the flash and memory size in your pull request is correct?
|
Yes it should be correct. |
@fpistm thank you. When going from cubeIDE to arduinoIDE with the same MCU, same clock configuration I lose access to my board and have to perform a Under Reset chip erase, I wonder if it could be that the variant_generic files also need to be adjusted. |
If I disable USB CDC this doesn't happen, but I am able to create the Virtual Com Port in CubeIDE and use it. |
Your clock config uses the HSE? By default it is:
|
OK thanks. |
Fixes #2653. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Hi, still related to this Generic STM32WB board. I still seem to be unable to start the BLE service. When I try to run in the debugger the code seems to hand in the
in My clock config looks like this now (I've just placed in my main sketch for now, but it is being called (I've checked with breakpoints in the debugger)
Is there anything else that I need to account for in the variant configuration? |
Hi @federica-ven I didn't see any hsem_lock, I'm not an expert but IIRW it is required. /* This prevents concurrent access to RCC registers by CPU2 (M0+) */
hsem_lock(CFG_HW_RCC_SEMID, HSEM_LOCK_DEFAULT_RETRY);
...
/* This prevents concurrent access to RCC registers by CPU2 (M0+) */
hsem_lock(CFG_HW_RCC_SEMID, HSEM_LOCK_DEFAULT_RETRY);
...c
hsem_unlock(CFG_HW_RCC_SEMID); Other point, is the RNG as stated in other WB clock config: /* RNG needs to be configured like in M0 core, i.e. with HSI48 */ Could you try to mimic those one. Some other point:
#define HSE_VALUE (32000000UL) /*!< Value of the External oscillator in Hz */
|
Hi @fpistm apologies, do you want me to move this in a stm32duinoBLE issue?
Yes I did
Yes, I have re-defined it just in case to be 32MhZ in my core.
Can you elaborate a little on this? I'm not sure I understand what I need to change, if anything?
I have also added it again, to try. But I still can't seem to see the BLE device. |
As said try to mimic the clock config, this is part of the config: Arduino_Core_STM32/variants/STM32WBxx/WB55R(C-E-G)V/variant_P_NUCLEO_WB55RG.cpp Lines 147 to 158 in 7095e16
|
Seems like if I had the locks my board overheats and becomes unresponsive. So I have to remove those, I'm not sure what they do but it doesn't sit well with the hardware.
I've added that part to my clock, and it seemed to do the trick. Now I'm able to see the device on the Toolbox app. But the SerialUSB becomes unresponsive right after. |
I have found some discussion on the ST Community about this conflict between the peripherals, sharing the same clock. Could be related to this issue now: https://community.st.com/t5/stm32-mcus-wireless/usb-device-does-not-work-when-starting-ble-stack-on-stm32wb55/td-p/176360 Adding this in my SystemClock_Config /**
* This prevents the CPU2 to disable the HSI48 oscillator when
* it does not use anymore the RNG IP
*/
LL_HSEM_1StepLock( HSEM, 5 );
PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48; seems to work. |
Seems logical, as when the cpu2 disable the RNG, it disables the HSI48 but if the clock ressource is lock thanks the hardware semaphore it prevents to disable the HSI48 also used by USB as input clock. |
https://www.st.com/en/microcontrollers-microprocessors/stm32wb55vg.html
I can see there's a folder in the stm32 core
WB55V(C-E-G)(Q-Y)_WB55VYY
but it doesn't show as an in the IDE?The text was updated successfully, but these errors were encountered: