Saving to NVM on STUSB4500 using STSW-STUSB003
I am porting the STSW-STUSB003 to my STM32 project that uses a different MCU than the NUCLEO-F072RB. Though it wouldn't matter, I need the functionality in our MCU for production, not an external Nucleo dev board.
I can make changes in RAM, but cannot save to NVM. I'm trying to write to NVM simply using `nvm_flash(Usb_Port);`, but the program hangs.
Using STUSB4500_GUI_v1.0.7, I make the changes and save the NVM configuration and paste that into STUSB_NVM.h.
Since the main.c code doesn't use nvm_flash and the github code has a typo in #include "USB_PD_defines_STUSB-GEN1.h", I suspect this code isn't actually tested and working.
Can anyone confirm getting NVM writes working with the STUSB4500 using the STSW-STUSB003 library?
Should it be as straightforward as saving the NVM_config_STUSB45.h from GUI 1.07 and then in main a simple `nvm_flash(Usb_Port);`? I don't really understand how/why FTP_CUST_PASSWORD (which should be the password, right?) is listed as a register definition set to 0x47. There is a Buffer[10] for a defined value of 0x47? What am I missing here? Is there some app note that explains all this password protection that I missed?
Lastly, the function CUST_ExitTestMode with the word "test" implies changes are not intended to be saved to nvm, whereas this functionality to me, would specifically NOT be for testing and would be for production. Shouldn't this be called CUST_ExitWriteMode?
Thanks in advance
