Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PIC16F1939 bootloader assitance
#1
Hello,

This is my first time using any bootloader so my experience is very limited.
I downloaded the ds30 loader free edition and tried building the project found at "firmware_12F_16F_XC8" folder using  MPLAB X IDE v6.15
I am having trouble building the project even without making any changes(except putting a comment on "#error Do you need to configura uart pins to be digital? If not, remove this line")

When trying to build using the version mplab set(pack 1.2.63, xc8 v1.31) I get the following:
Code:
../src/user_code.inc:110:: error: (800) undefined symbol "EEADR"
../src/user_code.inc:132:: error: (800) undefined symbol "FSR"
../src/user_code.inc:134:: error: (800) undefined symbol "INDF"
../src/user_code.inc:211:: error: (800) undefined symbol "EEDATA"
../src/uart.inc:128:: error: (800) undefined symbol "SPBRG"
../src/uart.inc:135:: error: (800) undefined symbol "SPBRGH"
../src/uart.inc:137:: error: (800) undefined symbol "BAUDCTL"



When trying pack 1.6.241 and xc8 v1.31 :
Code:
"G:\Microchip\xc8\v2.31\bin\xc8-cc.exe" -c  -mcpu=16F1938  -D__DEBUG=1  -mdebugger=none  -mdfp="G:/Microchip/MPLABX/v6.15/packs/Microchip/PIC12-16F1xxx_DFP/1.6.241/xc8"  -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mno-default-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto  -o build/default/debug/_ext/1360937237/ds30loader.o  ../src/ds30loader.s
Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "G:/Microchip/MPLABX/v6.15/packs/Microchip/PIC12-16F1xxx_DFP/1.6.241/xc8\pic\dat\ini\16f1938.ini" at line 185
Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "G:/Microchip/MPLABX/v6.15/packs/Microchip/PIC12-16F1xxx_DFP/1.6.241/xc8\pic\dat\ini\16f1938.ini" at line 195
Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "G:/Microchip/MPLABX/v6.15/packs/Microchip/PIC12-16F1xxx_DFP/1.6.241/xc8\pic\dat\ini\16f1938.ini" at line 185
Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "G:/Microchip/MPLABX/v6.15/packs/Microchip/PIC12-16F1xxx_DFP/1.6.241/xc8\pic\dat\ini\16f1938.ini" at line 195
"G:\Microchip\xc8\v2.31\bin\xc8-cc.exe"  -mcpu=16F1938 -Wl,-Map=dist/default/debug/ds30Loader_12F_16F.X.debug.map  -D__DEBUG=1  -mdebugger=none  -DXPRJ_default=default  -Wl,--defsym=__MPLAB_BUILD=1  -mdfp="G:/Microchip/MPLABX/v6.15/packs/Microchip/PIC12-16F1xxx_DFP/1.6.241/xc8"  -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mno-default-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto        -Wl,--memorysummary,dist/default/debug/memoryfile.xml -o dist/default/debug/ds30Loader_12F_16F.X.debug.elf  build/default/debug/_ext/1360937237/ds30loader.o   
Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "G:/Microchip/MPLABX/v6.15/packs/Microchip/PIC12-16F1xxx_DFP/1.6.241/xc8\pic\dat\ini\16f1938.ini" at line 185
Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "G:/Microchip/MPLABX/v6.15/packs/Microchip/PIC12-16F1xxx_DFP/1.6.241/xc8\pic\dat\ini\16f1938.ini" at line 195
Non line specific message::: warning: (1020) unknown attribute "CONFIGPROG" in chipinfo file "G:/Microchip/MPLABX/v6.15/packs/Microchip/PIC12-16F1xxx_DFP/1.6.241/xc8\pic\dat\ini\16f1938.ini" at line 185
Non line specific message::: warning: (1020) unknown attribute "IDLOCPROG" in chipinfo file "G:/Microchip/MPLABX/v6.15/packs/Microchip/PIC12-16F1xxx_DFP/1.6.241/xc8\pic\dat\ini\16f1938.ini" at line 195
:0:: error: (500) undefined symbols:
_main(E:\TMP\skek.o) start_initialization(E:\TMP\skek.o)
build/default/debug/_ext/1360937237/ds30loader.o:74:: error: (501) program entry point is defined more than once
(908) exit status = 1


When trying pack 1.6.241 xc8 2.41:
Code:
::: error: (2096) undefined symbol "_main" (E:\TMP\xcBsis4.1\driver_tmp_6.o)
::: error: (2096) undefined symbol "start_initialization" (E:\TMP\xcBsis4.1\driver_tmp_6.o)
build/default/debug/_ext/1360937237/ds30loader.o:70:: error: (501) program entry point is defined more than once


I am not really sure how to tackle the problem since I'm guessing this build has already been tested and works for other people and depending on the version I am using I keep getting different errors.
Any help will be appreciated!
Reply
#2
Hello,
Please zip the complete MPLAB X IDE project and post it here and I will have a look.
Reply
#3
It seems like you're facing version conflicts between your toolsets, especially the DFP and XC8 versions. Try using an older XC8 version (like 1.45) that matches the DFP version others have used successfully. Also, make sure to remove all duplicate "_main" definitions and check the dependencies.
Sometimes these errors happen due to improper memory configuration within different MPLAB versions, so check linker settings too Big Grin
Reply
#4
Troubleshooting ds30 Loader Build Issues in MPLAB X
It looks like you're experiencing several issues when trying to build the ds30 loader project. Let me help you analyze and resolve these problems.

Understanding the Errors
With XC8 v1.31 and older device pack (1.2.63):
The undefined symbols (EEADR, FSR, INDF, etc.) suggest the compiler isn't properly recognizing the PIC16F1938's special function registers. This typically happens when:

The correct header files aren't being included

There's a mismatch between the compiler version and device support

With newer versions:
The "undefined symbol _main" and "program entry point defined more than once" errors indicate the project configuration may need adjustment for newer compiler versions.

Recommended Solutions
Use compatible tool versions:

The ds30 loader was likely developed for older XC8 versions

Try using XC8 v1.45 or v2.00 (a middle ground between very old and very new)

Use device pack version 1.3.231 if available

Project configuration fixes:

Right-click your project > Properties

Under "XC8 linker", check "Use alternate settings" and add:

--codeoffset=0x800
Ensure "Linker Heap" and "Linker Stack" sizes are set to 0 for bootloader projects

Source code modifications:

For the register errors, try adding at the top of user_code.inc:

c
#include <xc.h>
#include <pic16f1938.h>
For the entry point conflict, check if there are multiple definitions of main() or the reset vector

Alternative approach:

Try using the pre-built hex files that come with ds30 loader if available

Contact ds30 support for version-specific build instructions

Additional Tips
Make sure you've selected the correct device (PIC16F1938) in project properties

Clean the project (right-click > Clean) before rebuilding

Check the ds30 loader documentation for any version-specific requirements

Consider setting up a virtual machine with an older MPLAB X version (v5.xx) if you continue having issues

The ds30 loader is known to work best with older toolchain versions, so persistence with version compatibility is key here. If you continue having issues, you might want to consider alternative bootloaders like Tiny Bootloader or the built-in USB HID bootloader if your application allows.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)