UMC Build Error

Discuss the Integrated Development Environment (IDE)

Moderators: David Barker, Jerry Messina

RKP
Registered User
Registered User
Posts: 81
Joined: Mon Oct 22, 2007 3:14 pm
Location: Maryland

UMC Build Error

Post by RKP » Sat Sep 12, 2020 2:43 am

I am struggling to get a UMC Builder to create a hex file.
After adding the paths for the MPASM and the device files.
The last error that I can't over come is this : It gives a UMC Generation Error of " Device "18F452" cannot self program"
I am sure it is an operator error but i cannot seem to figure it out.
I am using the umcbuild.ini that came with the compiler the changes are below.

Code: Select all

[code][code]; optional path information - default output folder is
; user documents -> umcbuild...
[PATH]
;MPASM=C:\Program Files (x86)\Microchip\MPLABX\v5.35\mpasmx
MPASM=C:\Program Files (x86)\Mecanique\Swordfish\Bin
DB=C:\Program Files (x86)\Microchip\MPLABX\v5.35\mpasmx
;DB=C:\ProgramData\Mecanique\Swordfish\Includes
;Output=$app\firmware

; source code files...
[TEMPLATE]
PIC16=..\src\16F\umc_loader.asm
PIC18=..\src\18F\umc_loader.asm

; device name and OSC...
[MCU]
Device=18F452
OSC=20000000

; device configuration settings...
[CONFIG]   
config  OSC 	= HS		
config  PWRT    = OFF
config  WDT     = OFF
config  LVP     = OFF
config  DEBUG   = OFF

; place startup code in here...
[USERCODE]

[/code][/code]

It did not like the path to the MPLABX for MPASM but it did work pointing it to the Swordfish directory.
Both Device files paths worked.

Any suggestions would be greatly appreciated as i really want to use a bootloader for my application.

Thanks,
Keith

User avatar
David Barker
Swordfish Developer
Posts: 1186
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: UMC Build Error

Post by David Barker » Sat Sep 12, 2020 7:40 am

You will need to install a version of MPLAB (it's still available from the microchip site to download). The builder will not work with MPLABX.

Jerry Messina
Swordfish Developer
Posts: 1203
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: UMC Build Error

Post by Jerry Messina » Sat Sep 12, 2020 12:24 pm

I was able to get it to work with the files from mplabx, but I had to do the following:

- copy the folder "C:\Program Files (x86)\Microchip\MPLABX\v5.35\mpasmx" to a folder with no spaces, periods, or special chars, ie "C:\mpasmx"

- copy the file "C:\mpasmx\mpasmx.exe" to "C:\mpasmx\mpasmwin.exe"

- change the path line in umcbuild.ini to the new location for mpasm
you can comment out the 'DB='

Code: Select all

[PATH]
MPASM=C:\mpasmx
This should work for all versions of mplabx up to V5.35, which is the last version to support mpasm/mpasmx v5.87.
That will let you use devices not in the old mplab mpasm 5.51 (If you can figure out what other changes to the asm are needed!).

RKP
Registered User
Registered User
Posts: 81
Joined: Mon Oct 22, 2007 3:14 pm
Location: Maryland

Re: UMC Build Error

Post by RKP » Sun Sep 13, 2020 2:06 am

Jerry, I did the changes that you suggested but now the error is.
No device file found for "18F452"

David, I downloaded MPLAB 8.92 and I get the same error above.

Thanks for your suggestions but i guess no bootloader for me.

Keith

Jerry Messina
Swordfish Developer
Posts: 1203
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: UMC Build Error

Post by Jerry Messina » Fri Sep 18, 2020 3:20 pm

I did a little poking around with this and found that the reason that it worked for me was because I also have the old MPLAB 8.92 installed,
and as David pointed out you need some of the files from MPLAB that aren't in mplabx.

The file you need for umcbuild.exe is a '.dev' file to match your device, ie for the 18F452 you need the file 'PIC18F452.dev'
In the old MPLAB those files are in the folder "Microchip\MPLAB IDE\Device" (which I think you'd find in C:\Program Files (x86) if you did a standard mplab install, but don't quote me on that).

On my system, I have the file PIC18F452.dev in "D:\Programs\Microchip\MPLAB IDE\Device\" since I did a custom mplab install.
That's the 'DB=' path that you'd need to set in umcbuild.ini... for you it might look something like:

Code: Select all

MPASM=C:\mpasmx
DB=C:\Program Files (x86)\Microchip\MPLAB IDE\Device
MPLABX doesn't use '.dev' files... that info is now in a '.PIC' file (but they're not the same format).
So, for right now you can only use UMCbuild with devices that were supported in MPLAB 8. Sorry if I confused things.

RKP
Registered User
Registered User
Posts: 81
Joined: Mon Oct 22, 2007 3:14 pm
Location: Maryland

Re: UMC Build Error

Post by RKP » Sun Sep 20, 2020 6:04 pm

Jerry,

Thanks, that solved the issue. I can now make a bootloader for the 18F452.
Unfortunately for me I would like to make a bootloader for the PIC18F46K42.
Since that PIC is a fairly new part, there is not a device file in the old MPLAB 8.92.

I did see your post "new SystemConvert V1.40" about the python script file that generates the .dev files and it's unavailability.
It's ashamed the MC changes their files that makes the the UMCbuilder not useful for newer parts.

Keith

Jerry Messina
Swordfish Developer
Posts: 1203
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: UMC Build Error

Post by Jerry Messina » Sun Sep 20, 2020 10:32 pm

I have bootloaders for the K22 and K40 but none for the K42.

I'll put together a converter tool to generate the .dev file info from the mplabx files.
In the meantime I'll see what's needed for a K42 loader... maybe I could do a standalone .asm file that you could assemble with mplabx.

RKP
Registered User
Registered User
Posts: 81
Joined: Mon Oct 22, 2007 3:14 pm
Location: Maryland

Re: UMC Build Error

Post by RKP » Mon Sep 21, 2020 12:11 am

Wow, thanks Jerry.
Looking forward to using a bootloader with the 46K42.
I surely would like to buy you a beer, that's of course if you consume alcohol.

Keith

Jerry Messina
Swordfish Developer
Posts: 1203
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: UMC Build Error

Post by Jerry Messina » Tue Sep 22, 2020 4:17 pm

I surely would like to buy you a beer
IMHO that's the biggest problem with the internet... virtual beer just doesn't cut it!

Anyway, here's a UMC bootloader for the K42. It's a standalone .asm file that supports the whole 18FxxK42 family.
Just assemble it with mpasmx.exe to create the hex file.

There's a few sections that you will likely need to change...

Code: Select all

;=============================================================================
; USER CONFIGURATION SECTION
;=============================================================================
   processor                        18F27K42
   #define DEVICE_CLOCK             64000000    ; for intosc select 8/16/32/64MHz
   #define INTOSC                   1           ; 0=ext osc, 1=internal HFINTOSC
   #define BAUDRATE                 115200      ; negotiated baudrate after startup
   

;-----------------------------------------------------------------------------
; UART PORT/PIN selection
; modify this section to match your hardware configuration
; note that the K42 PPS mapping only allows certain port selections:
; UART      2xK42   4xK42   5xK42   
; UART1     B,C     B,C     C,F
; UART2     B,C     B,D     B,D
; the following settings are for UART1 with PORTC RC6(TX out) and RC7(RX in) pins
;-----------------------------------------------------------------------------
#define UART_     1           ; UART select, 1 or 2
#define TX_PORT_  PORTC       ; TX output, PORTA-PORTF
#define TX_BIT_   6           ; TX output bit, 0-7
#define RX_PORT_  PORTC       ; RX input, PORTA-PORTF
#define RX_BIT_   7           ; RX input bit, 0-7
If you change those entries it should take care of everything else for you.

If you want to check it out before trying to download your app code, there's test code you can enable...

Code: Select all

  ; '#define TEST_UART' adds a poweron uart check routine that you can use
  ; to verify that the uart/clock is working properly. it sends an initial "U>"
  ; sequence and then loops echoing received chars. test with a terminal emulator
  ; or the SF IDE serial communicator (it uses the DEFAULT_BAUDRATE setting).
  ;#define TEST_UART 1        ; uncomment to add uart test code
If it works then you can comment out '#define TEST_UART' and rebuild... you should have a working
bootloader hex.

If you want the UMC loader app to recognize the chip part number, add the following to the file \MCLoader\UMC\devices.ini

Code: Select all

0x6CA0, 18F24K42
0x6C80, 18F25K42
0x6C60, 18F26K42
0x6C40, 18F27K42
0x6C20, 18F45K42
0x6C00, 18F46K42
0x6BE0, 18F47K42
0x6BC0, 18F55K42
0x6BA0, 18F56K42
0x6B80, 18F57K42
I could only test it with an 18F27K42, but it should work for the others as well.
Attachments
umc_18FxxK42.zip
(7.78 KiB) Downloaded 2 times

RKP
Registered User
Registered User
Posts: 81
Joined: Mon Oct 22, 2007 3:14 pm
Location: Maryland

Re: UMC Build Error

Post by RKP » Wed Sep 23, 2020 2:07 am

Thanks Jerry, can't wait to try it out.
After I figure why the TMR2 and PWM5 don't work on the 46K22 but worked fine on 26K22.

Keith

bitfogav
Registered User
Registered User
Posts: 164
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: UMC Build Error

Post by bitfogav » Wed Sep 23, 2020 8:27 am

Anyway, here's a UMC bootloader for the K42. It's a standalone .asm file that supports the whole 18FxxK42 family.
Just assemble it with mpasmx.exe to create the hex file.
I'm sorry to gatecrash this topic, but I have just needed a bootloader for the 18F47K42, I am going to sound really dumb here but how does one compile the .asm file in MplabX v5.40 ? :roll:

EDIT*
Ok I see the latest MplabX v5.40 no longer supports mpasm, I have installed an older version of MplabX v5.35, now when I compile the .asm with only changing the device code to 18F47K42, I get an error with the following code:

error: Operand contains unresolvable labels or is too complex

Code: Select all

; check to make sure program fits 26-5-2018
#if ($ > DEVICE_ROM)
  error "program code exceeds flash size. change LOADER_SIZE_MIN"
#endif

Jerry Messina
Swordfish Developer
Posts: 1203
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: UMC Build Error

Post by Jerry Messina » Wed Sep 23, 2020 10:29 am

Right, you need MPLABX 5.35... that's the last version that has the MPASM assembler.

If you're trying to build this in mplabx, open the project properties, navigate to 'mpasm (Global Options)' and check 'Build in absolute mode'.

I find it easier to just assemble it outside of mplabx. If you run mpasmx.exe it'll open a window where you can navigate to the .asm file and assemble it.
That way you don't have to deal with creating a project and all the oddities that go along with what mplabx does to the output file.

mpasmx will create 'umc_18FxxK42.hex' which you can program into the K42 using the mplabx IPE programmer app, or IPECMD command-line tool.

bitfogav
Registered User
Registered User
Posts: 164
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: UMC Build Error

Post by bitfogav » Wed Sep 23, 2020 10:58 am

If you're trying to build this in mplabx, open the project properties, navigate to 'mpasm (Global Options)' and check 'Build in absolute mode'.
Thank you Jerry that has fixed the compile error, that and MplaX v5.35. :D Also I can't thank you enough for sharing all this great information..

Jerry Messina
Swordfish Developer
Posts: 1203
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: UMC Build Error

Post by Jerry Messina » Wed Sep 23, 2020 11:25 am

Thanks, Gav.

One other thing... I only tested this using the internal osc (I'm too lazy to go find my other dev boards), so if anyone has problems using an external xtal let me know. It's supposed to switch the config settings for you based on '#define intosc' but I didn't check to see if I got those settings/code right or not.

bitfogav
Registered User
Registered User
Posts: 164
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: UMC Build Error

Post by bitfogav » Sun Sep 27, 2020 5:57 pm

Sorry to be a pain again Jerry, I was looking at compiling just the .asm file using mpasmx.exe outside of Mplab-X, As I've never done this method before what would be the recommended settings to set in the mpasmx interface?.
MPASM80Hex.jpg
MPASM80Hex.jpg (83.82 KiB) Viewed 5 times

Post Reply