MPLABX, XC16 and PIC24F - Printable Version +- ds30 Loader free edition forums (https://picbootloader.com/forum) +-- Forum: Support (https://picbootloader.com/forum/forumdisplay.php?fid=3) +--- Forum: 16-bit firmwares (https://picbootloader.com/forum/forumdisplay.php?fid=6) +--- Thread: MPLABX, XC16 and PIC24F (/showthread.php?tid=2274) |
MPLABX, XC16 and PIC24F - Alistair - 2014-07-13 I have been trying to assemble ds30loader with xc16 in MPLABX for a pic24f. For some reason it is generating a .text section starting at 0x200 for __data_init_standard (according to the map file). I guess that there is some linker setting that I need, but I can not work it out. When I inspect the program it is clear that the 0x0 goto vector points to the bootloader program towards the end of program memory, but the bootloader does not seem to work. Does the bootloader need the __data_init_standard section, and should that section actually be part of the bootloader program in memory? If so, how do I change the linker or assembler settings to put it in the right place? I know I could just build it in MPLAB with C30, but I would have to download and configure all of that. MPLAB X is pretty stable since version 2.00 so I figure it is time to make sure we can compile ds30loader in it. RE: MPLABX, XC16 and PIC24F - Mikael Gustavsson - 2014-07-15 Hi, Please zip and post the boot loader project and I will take a look at it. RE: MPLABX, XC16 and PIC24F - Alistair - 2014-07-16 (2014-07-15, 00:07:31)Mikael Gustavsson Wrote: Hi, Thanks Micke. The file is attached. ds30Loader.X.zip (Size: 150.7 KB / Downloads: 56) RE: MPLABX, XC16 and PIC24F - Mikael Gustavsson - 2014-07-19 Thanks. You don't need to worry about linker scripts and such things. I notice that you haven't configured the configuration bits. That's most likely why the boot loader seem to not work. RE: MPLABX, XC16 and PIC24F - Alistair - 2014-07-27 (2014-07-19, 12:28:40)Mikael Gustavsson Wrote: Thanks. You don't need to worry about linker scripts and such things. Thanks Mikael. I manged to get the bootloader working. I can now assemble it with either XC16 or with ASM30 in MPLABX. This is what I did: - Import the 16bitfirmware MPLAB 8.x project into MPLABX. I selected the right processor (PIC24F32KA301) etc. - To get it working with ASM30 I had to explicitly add the processor specific linker file to the project. - With both ASM30 and XC16 I had to set the assembler include directories properly. - I altered settings according to your instructions. I set the CONFIG bits to match my application like this: Code: .ifdef IS_24F - I also had include 'clr ANSB' at the beginning of the UserInit macro to ensure the UART2 Rx is digital rather than analog. While both assemblers work, they do produce slightly different output. The goto at 0x00 and the actual boot loader code from 0x5640 is the same. However, both assemblers produce a code at 0x200. First, ASM30 produces this: Code: 257 200 DA4000 BREAK 0 Code: 257 200 880191 MOV W1, TBLPAG RE: MPLABX, XC16 and PIC24F - Mikael Gustavsson - 2014-08-01 Thanks for the report. 0x200 is the start address of the application. XC16 produces code to initialize variables. It is not needed by the boot loader and it will be overwritten by the application. You can turn it of by the "Don't initialize data sections" linker option. When you do the output will be the same as with ASM30. |