We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
ISO/IEC 12207 (1995) 5.3.7.5 e) states: "Appropriateness of coding methods and standards used;". The generally accepted commercial practices recommend using mnemonics instead of numeric values. The pflash.a66 violates this principle. In addition, 12207, Annex B, "Guidance on tailoring" provides for tailoring. Recommendation(s): (1) If Keil has tailored its software development plan to eliminate the use of mnemonics from its coding standards, they should explicitly state so in appropriate areas such as: an application note, headers of example files, etc. (2) If Keil has not explicitly tailored their development plan to eliminate the use of coding standards, they should review their coding standard and publish it for us, the users. (3) Keil should change the constants to mnemonics in pflash.a66.
Well, I'm sure Keil would welcome your contribution if you'd like to re-write it for them! ;-)
Several observations from your recent postings; 1) Usually when I get an error report from a known good header file (Reg167.h) it has to do with modifications I made to a previously included header file. Since the data on 'P8', 'DP8' and 'ODP8' is correct I would assume I screwed it up somewhere. 2) Programming on-board flash is not a trivial matter. If you look through the development board and CPU vendor's notes you will see they all use virtually identical coding. They also all use assembly language because in most flash programming there are areas of code that cannot be interrupted and in some cases (ST10F167) certain areas of memory cannot be accessed while the flash is enabled for programming. A call to a compiler function (like hcasting) or pushes on an internal stack or segment addressing can blow the programming (On the 'F167 the failure mode has been a weakly programmed bit which toggles after a period in the field). External flash usually has fewer problems with this but still might have areas where interrupts will cause problems. 3) The code in App138 is an example and should be used as such. It does work and can provide a good starting point for user code. Starting there, it took alot of work to make our program so it could perform the serial download simultaneously with the flash programming, all assembly language. 4) While I've not had good luck with Keil support (missing DLLs, no knowledge of RTX166, ...) their App notes do provide reasonable examples. Even if they are not up to the highest standards of modern coding, I work with much worse on a daily basis. Best luck