Hi David, An option would still be to add a constant to all device files with the name ROMSIZE but I do not see any other application (yet) than using it for determining the offset address for the HEF.
It would make your program al little bit easier to port to another PIC with different ROM size. Maybe there are other applications for this ROMSIZE constant, so if anybody knows .... Kind regards, Rob ________________________________ Van: [email protected] <[email protected]> namens [email protected] <[email protected]> Verzonden: dinsdag 1 november 2022 17:47 Aan: jallib <[email protected]> Onderwerp: Re: [jallib] HEF usage: One suggestion and one question Hi, Thanks Rob. I had a look in the 16F1705.pic file, and indeed, it seems impossible to calculate the exact offset for the start of the HEF area..... Anyway, thanks for the info: I learned a lot ! Kind regards, David Le dimanche 23 octobre 2022 à 19:11:42 UTC+2, [email protected] a écrit : Hi David, The XML files are provided by Mircochip if you download MPLABX. If we would want to use the ROM code size (which is known from the XML) it woule be possible to add something like this to the compiler functionality: target_code_size So in your program you would have something like: const HEF_OFFSET_ADDRESS = target_code_size - HEF_NR_OF_BYTES (or just minus 128). I attached the XML for your PIC. Kind regards, Rob ________________________________ Van: [email protected] <[email protected]> namens [email protected] <[email protected]> Verzonden: zondag 23 oktober 2022 16:48 Aan: jallib <[email protected]> Onderwerp: Re: [jallib] HEF usage: One suggestion and one question Just another thought: In the device include file of older PIC's with dedicated eeprom, I see a directive defining that eeprom, by adress and size. For example, for a 16F628A : pragma eeprom 0x2100,256 Is this the kind of info you retrieve from the XML files ? For my information, where could I see the content of such a XML file (say the one for the 16F1705 I use) ? Le dimanche 23 octobre 2022 à 16:38:42 UTC+2, [email protected] a écrit : We asked Microchip for the information. We are Microchip Approved Software Partners so we can ask for key information. This information was the used to populate the PIckit parts database. ------ Get Outlook for Android<https://aka.ms/AAb9ysg> ________________________________ From: [email protected] <[email protected]> on behalf of [email protected] <[email protected]> Sent: Sunday, October 23, 2022 3:35:36 PM To: jallib <[email protected]> Subject: Re: [jallib] HEF usage: One suggestion and one question Thanks all for those creative answers @Rob : Indeed, using one HEF location as an indicator to know if the settings have already been initialised or not was my fallback solution. As you explain (and I wasn't aware of that), if you do not receive the value in the XML from Microchip, you can not put that value in the include file.... unfortunately. About the discussion to deduce the offset by assuming the HEF size is always 128 bytes, that seems very risky to me. Furthermore, in the document Rob H linked, there are already a bunch of PIC's for which that size is not at all 128 bytes..... I do not know what data is included in the Microchip XML files, but how does the programmers (ICD, PicKit, ....) know how much HEF there is ? Or do they not at all make the difference between normal flash and HEF ? Seems weird to me (but I'm not an expert).... Enjoy your Sunday Daiv Le dimanche 23 octobre 2022 à 13:11:27 UTC+2, Rob Hamerling a écrit : Hi RobJ and others, My assumption that HEF-size is always 128 comes from: https://ww1.microchip.com/downloads/en/DeviceDoc/30010068G.pdf In the explanation colums it says: HEF: High–Endurance Flash 128B Non–volatile data storage with high–endurance 100k E/W cycles It doesn't say if it is always in the highest program address region. Searching all datasheets isn't the favorite aspect of my hobby.... As far as size of program memory concerns: the device file contain a "pragma code", but I cannot find in the docs if there is a companion built-in constant definition, for example like there is one for bank size: "CONST target_bank_size = cexpr". If such a constant doesn't exists yet it would be handy to add it to the compiler. Regards, RobH -- Rob Hamerling, Vianen, NL -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/61cdd53e-398c-4c2d-8786-2762984b7e3an%40googlegroups.com<https://groups.google.com/d/msgid/jallib/61cdd53e-398c-4c2d-8786-2762984b7e3an%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/02a30931-3dbe-4249-a3b2-4dcfe77aa78cn%40googlegroups.com<https://groups.google.com/d/msgid/jallib/02a30931-3dbe-4249-a3b2-4dcfe77aa78cn%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]<mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/c55d7e89-c153-4847-a0f4-7d51669bc9afn%40googlegroups.com<https://groups.google.com/d/msgid/jallib/c55d7e89-c153-4847-a0f4-7d51669bc9afn%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/GVXP195MB16374C16312D8EB1E80DBAC8E6369%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM.
