----- Ursprüngliche Nachricht ----- Von: Peter Bigot Gesendet am: 15 Mrz 2011 03:01:26
> I think Eric misinterpreted Crazy Casta's position on watchdog, though I'm > very sympathetic to the "least surprise" principle, and yes, it will waste a > lot of people's time if this change isn't made very clear. But the MSP430 > has a watchdog feature, people *should* be aware of it, and consistency with > TI's tools and documentation means mspgcc shouldn't pretend it's not there. Well, I mus tsay I was really surprised to see that the watchdog, while documented as being active after a reset, in fact was inactive in all my projects. It took me quite some time (I had to dig into MSP assembly) to figure out that MSPGCC was silently disabling it. Yes, if a watchdog reset occurs due to long init code before the user code can deactivate or trigger the WDT, this would be a surprise. And I had this case several times in the TI E2E community when people were using large initialized arrays. This is, however, easier to discover than a hidden manipulation of the hardware. BTW: On newer MSPs, such as the 54xx, the default WDT timeout is soo long (and the default speed so high) that even the full use of the 16k ram won't trigger a timeout. With these devices, triggering of the WDT is not necessary. > Anybody who doesn't want to deal with it in user code can put this: > WDTCTL = WDTPW + WDTHOLD; // Stop WDT > at the top of main(), as is done in every TI example program I've seen That's at least conforming to the docs and what someone would expect wo does not know about compiler internals and just uses C. > But so is being able to compile main.c with -g, and perhaps so is having > separate recovery code in __stop_progExec__ (e.g. for uncaught exceptions). > All can be accommodated by using this construct: > __attribute__ ((naked,section(".init9"))) >void main () ... > which will simply put the main routine directly inside the init section > after everything else has been done. The order in which things are >presented to the linker means the init code will simply fall into (and, if >necessary, out of) main. Indeed, this would work. But that's also 'advanced stuff'. Especially people who use the G line are newbies. Of course mspgcc could be promoted as 'expert stuff' not aimed at 'normal' MSP users but rather for experienced compiler-knowers, but I don't think this would be a good direction to go. Let's keep in mind that an MSP is no PC. So there is no point in desperately implementing things that are useless on an MSP 'just for conformity'. Also, there should be no problem putting main automatically into .init9 by the linker script. BTW: the other compilers for MSP (IAR/CCS) enter LPM4 on main exit as default, rather than jumping in place. [...] > Thanks to all for the feedback. I think this is going to be a fine > solution, with reasonable default behavior, the freedom for special > situations to be handled without significant impact on either the developer > or the toolchain maintainer, and a clear indication of what's going on made > explicit in the source rather than hidden in compiler options inside a > Makefile or build script. Well, I agree that clean expression of what's going on may be better than hiding it, but then, all that needs special care to get optimum performance for default cases, means that default user will never get optimum performance. After all the most people using MSP are MSP users and not mspgcc designers. After one year in the TI E2E community, I'd say that about 90% of the people coming there wouldn't be able to understand how to 'master' mspgcc. Many of them even seem to be unable to understand that an MSP is no PC at all. JMGross ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users