I write a Bootloader for a FM4 CY9BF368 with the Standard Frequenz of 160 MHz.
After I change the Program counter
_asm("LDR PC, [R0, #4]"); //Load new program counter address
the Firmware doesn't start if it is compiled with the Frequenz of 8MHz.
If the Frequenz of the Firmware are change to 160 MHz it works.
Here are the different Settings at System_mb9b360r.h
APBC0_PSR_Val ( 0x00000000ul)
APBC2_PSR_Val ( 0x00000080ul)
SCM_CTL_Val ( 0x0000002Aul)
APBC0_PSR_Val ( 0x00000001ul)
APBC2_PSR_Val ( 0x00000081ul)
SCM_CTL_Val ( 0x00000052ul)
What going wrong ?
Can I change the Frequenz during the lifetime of the bootloader before I jump to the Firmware ?
you can switch the clock (Frequency) during run time.
See FM4 Peripheral Manual Main part https://www.cypress.com/file/222996/download chapter 2-1,
and/or PDL Clock Functions (CLK).