- Wed Jun 21, 2006 12:06 pm
#14787
Just wanted to point out a potential problem when using the sam7s flash programming capability.
I'm using reset_halt in my configuration file. I connect to my target, issue a reset, and then do a flash info. Since the main oscillator has not been enabled, the MAINRDY bit is not yet set, so the clock speed info is not valid. However, cidr in the at91sam7_info structure does get set. Any subsequent attempts to read the part info are blocked by code that tests for a non-zero cidr. This makes it necessary to kill the openocd server and restart it, then allow the processor to run until the clock is configured. At this point the flash commands should operate as expected. I'm not sure what the proper solution is in the case of an erased part. It looks like writing a 0 to FMCN may be okay in this case since the clock period should be greater than 30 us, but I'm not sure.
Also, if I'm interpreting the datasheet correctly, FMCN should be set based on the Master Clock frequency, not the Main Oscillator frequency. I think we need to take the PLL configuration into account.
Comments?
Galen
I'm using reset_halt in my configuration file. I connect to my target, issue a reset, and then do a flash info. Since the main oscillator has not been enabled, the MAINRDY bit is not yet set, so the clock speed info is not valid. However, cidr in the at91sam7_info structure does get set. Any subsequent attempts to read the part info are blocked by code that tests for a non-zero cidr. This makes it necessary to kill the openocd server and restart it, then allow the processor to run until the clock is configured. At this point the flash commands should operate as expected. I'm not sure what the proper solution is in the case of an erased part. It looks like writing a 0 to FMCN may be okay in this case since the clock period should be greater than 30 us, but I'm not sure.
Also, if I'm interpreting the datasheet correctly, FMCN should be set based on the Master Clock frequency, not the Main Oscillator frequency. I think we need to take the PLL configuration into account.
Comments?
Galen