2015-01-23 06:58 AM
Hi,
I think I've found a ''bug'' in the bootloader. AN2606 documents for '051 chips on page 58 that: [quote] When the user application configures a value of HSI TRIM bits (in RCC_CR register) and then jumps to the bootloader, the HSITRIM value is reset to its default value (0) at bootloader startup[/quote]The same thing seems to happen for the 072 bootloader. But that isn't the problem... The problem is that the HSI TRIM default is not 0 but 16. This results in the CPU running about 40kHz * 16 = 640 kHz slower than the 1% calibrated 8MHz..... Apparently ''autobauding'' for the serial ports and ''crystalless USB'' end up compensating for this so that nobody has noticed that the bootloader runs at a multiple of 7.3MHz instead of 8MHz. All this isn't really a problem until you let the bootloader jump to your application and then end up with baud rates that are off by ''too much''. P.S. I checked the datasheet for the '51 and it too has ''16'' as the default HSITRIM. #nmp2015-01-23 08:45 AM
The user application code really needs to configure it's environment the way it wants and be agnostic to initial conditions.
2015-01-28 01:51 AM
2015-02-26 12:17 AM
Hi Roger,
Thank you for reporting this issue, we confirm that reset value is not set correctly when Bootloader jumps to user application (0x03 instead of 0x83).This limitation will be reported in next release of AN2606.We apologize for any disagreement.Regards,Heisenberg.2015-02-26 04:05 AM
I'm really sorry, but now you're pissing me off.
Whatever, I have no responsibility with regard to this, and even less to the hundreds of thousands of parts that are ROM'd with code that isn't doing what you'd like. Fixing new devices won't address anything that you'd still need to address yourself. Your best course of action is to identify, in your code, devices that have zero written into the register and change it to 16 or whatever you think is a more reasonable default.The proper response is: ''You might be right, we'll investigate, and if it turns out you're right, we'll document it as a ''limitation'' and fix it for future revisions. Thank you for reporting this''. From whom? Who would give you such a response, and where do I fit into that matrix?2015-02-26 05:55 AM
> where do I fit into that matrix?
Well, apparently, you are The Keymaker, Clive... ;) (Sorry, I couldn't resist.) Jan