• AVR Freaks

AnsweredHot!no psect specified for function variable/argument allocation

Author
pajuhesh80
Super Member
  • Total Posts : 88
  • Reward points : 0
  • Joined: 2019/12/08 11:23:37
  • Location: Nowshahr, Mazandaran, Iran
  • Status: offline
2020/07/01 05:27:46 (permalink)
0

no psect specified for function variable/argument allocation

I want to learn PIC assembler and as there is no MPASM in MPLAB X v5.40, I'm using XC8.
First, I created a "Microchip Embedded> Standalone Project" for PIC18F47K42 and added a new "main.s" file to source files. Then I copied code in "http://ww1.microchip.com/downloads/en/DeviceDoc/XC8-PIC-Assembler-UG-for-EE-50002994A.pdf" pages 7-8 but compiler shows these errors:
:0:: error: (474) no psect specified for function variable/argument allocation
:0:: error: (450) psect "intsave_regs" was never defined, or is local

What is my mistake?

Slow and Steady!
#1
NKurzman
A Guy on the Net
  • Total Posts : 18858
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: no psect specified for function variable/argument allocation 2020/07/01 10:23:43 (permalink)
+2 (2)
MPASM was replaced with the Assembler built in to XC8
#2
1and0
Access is Denied
  • Total Posts : 10999
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/01 10:35:56 (permalink)
+2 (2)
Read Dan's review of the example code provided in the XC8 Assembler User's Guide in Post #10 here: https://www.microchip.com/forums/FindPost/1144826
#3
pajuhesh80
Super Member
  • Total Posts : 88
  • Reward points : 0
  • Joined: 2019/12/08 11:23:37
  • Location: Nowshahr, Mazandaran, Iran
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/01 12:01:59 (permalink)
+1 (1)
1and0
Read Dan's review of the example code provided in the XC8 Assembler User's Guide in Post #10..

Thanks. I read it and tried code in #15. still same error.
I'm getting mad on Microchip! Their software side is very very bad! This forum, XCF8 compiler,... Atmel was much more reliable in software and documents. Recently, I found that device signature is wrong in PIC18Ff14K50 datasheet.
 

Slow and Steady!
#4
dan1138
Super Member
  • Total Posts : 3731
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/01 12:32:22 (permalink)
+2 (2)
pajuhesh80
1and0
Read Dan's review of the example code provided in the XC8 Assembler User's Guide in Post #10..

Thanks. I read it and tried code in #15. still same error.
I'm getting mad on Microchip! Their software side is very very bad! This forum, XCF8 compiler,... Atmel was much more reliable in software and documents. Recently, I found that device signature is wrong in PIC18Ff14K50 datasheet.



Did you do this in your MPLABX v5.40 project:
; Add to the MPLABX project Additional options:
;   -Wa,-a -Wl,-presetVec=0h,-phi_int_vec=08h,-plo_int_vec=18h -Wl,-Map=main.map

 
<EDIT>
That line goes here:
 
 
Microchip has not made this simple, but your lack of experience is not a problem that Microchip alone can solve.
post edited by dan1138 - 2020/07/01 13:07:34

Attached Image(s)

#5
pajuhesh80
Super Member
  • Total Posts : 88
  • Reward points : 0
  • Joined: 2019/12/08 11:23:37
  • Location: Nowshahr, Mazandaran, Iran
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/01 12:37:52 (permalink)
0
dan1138
Did you do this in your MPLABX v5.40 project...

Yes I did.
Something strange: While searching, I found a thread in which someone said "... selected pic-as (2.20) toolchain ..." but when I'm creating new project, the only available toolchain is XC8 (2.20). Is that OK? (I tried reinstalling XC8)

Slow and Steady!
#6
dan1138
Super Member
  • Total Posts : 3731
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/01 12:56:20 (permalink) ☼ Best Answerby pajuhesh80 2020/07/01 13:03:48
+2 (2)
Microchip requires that you manually install the pic-as(v2.20) tool chain.

To open the tool chain install path dialog box the keyboard method to select the menu is: Tools->Options then click the (Embedded) tab then the (Build Tools) tab then click the (Add) button.

Select the Base Directory: C:<YourXC8compilerInstallPath>\xc8\v2.20\pic-as\bin

Finally click the (Ok) button. Then the other (Ok) button.

Now the pic-as(v2.20) tool chain will be available in the project configuration dialog box.
#7
pajuhesh80
Super Member
  • Total Posts : 88
  • Reward points : 0
  • Joined: 2019/12/08 11:23:37
  • Location: Nowshahr, Mazandaran, Iran
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/01 13:06:22 (permalink)
+1 (1)
dan1138
Microchip requires that you manually install the pic-as(v2.20) tool chain.

Thanks. I didn't know it. Now it is working. Where did you find this?

Slow and Steady!
#8
dan1138
Super Member
  • Total Posts : 3731
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/01 13:15:19 (permalink)
+1 (1)
pajuhesh80
dan1138
Microchip requires that you manually install the pic-as(v2.20) tool chain.

Thanks. I didn't know it. Now it is working. Where did you find this?

For all I know Microchip has not documented this anywhere.
 
The announcement that MPASM was removed from MPLABX v5.40 said the replacement is called "pic-as". So I went looking for it in the folders where XC8 v2.20 was installed. Then tried several folders until I could get the tool chain installer to do something useful. Pretty much dumb luck and persistence. :)
#9
ric
Super Member
  • Total Posts : 28009
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: no psect specified for function variable/argument allocation 2020/07/01 13:24:06 (permalink)
+1 (1)
I think I installed MPLABX 5.40 after I installed XC8 2.20.
pic-as showed up as a tool without having to do that.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#10
dan1138
Super Member
  • Total Posts : 3731
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/01 13:28:42 (permalink)
+1 (1)
@pajuhesh80,
 
The next thing you are going to find annoying is that MPLABX v5.40 does not yet support symbolic debug when using the pic-as(v2.20) tool chain.
 
There is something of a work around but it's damned inconvenient.
 
This thread is where we worked out a method:
 
https://www.microchip.com/forums/FindPost/1142190
 
It is tedious to use and really easy to get confused so a lot of experience with assembly language debug and MPLABX will be required.
#11
pajuhesh80
Super Member
  • Total Posts : 88
  • Reward points : 0
  • Joined: 2019/12/08 11:23:37
  • Location: Nowshahr, Mazandaran, Iran
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/01 13:32:01 (permalink)
+1 (1)
dan1138
For all I know Microchip has not documented this anywhere.

And another reason to be mad on Microchip! ;-)
 
dan1138
Pretty much dumb luck and persistence. :)

Congratulations. I have two other question:
  1. What does
    -Wa,-a -Wl,-presetVec=0h,-phi_int_vec=08h,-plo_int_vec=18h
    do exactly? I compared .hex file with and without it. When I use it, hex size increases about one line. Is it necessary to use it?
  2. In project dashboard tab, both program and data memory usages are always 0. I enabled project properties>Loading>Load symbols when ...

Slow and Steady!
#12
dan1138
Super Member
  • Total Posts : 3731
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/01 13:39:29 (permalink)
+1 (1)
ric
I think I installed MPLABX 5.40 after I installed XC8 2.20.
pic-as showed up as a tool without having to do that.

This never happens for me because I'm using a primitive operating system (Windows 10) and my project scripts require that the paths to my tools and source code folders do not contain spaces. So I do not use the default paths suggested by the Microchip installers.
 
A curious thing this about this is that the MPASM tool chain was always available regardless of what path I installed MPLABX on but the pic-as(v2.20) tool chain is only available when the default install paths are used. Could this be a bug in a Microchip installer? Heavens forfend! :)
post edited by dan1138 - 2020/07/01 13:46:00
#13
pajuhesh80
Super Member
  • Total Posts : 88
  • Reward points : 0
  • Joined: 2019/12/08 11:23:37
  • Location: Nowshahr, Mazandaran, Iran
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/01 13:39:52 (permalink)
+1 (1)
dan1138
The next thing you are going to find annoying is that MPLABX v5.40 does not yet support symbolic debug when using the pic-as(v2.20) tool chain.

I found a solution for it. Use Window>Target Memory Views>Program Memory. You can use breakpoints there. Totally not bad.

Slow and Steady!
#14
dan1138
Super Member
  • Total Posts : 3731
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/01 14:37:02 (permalink)
+3 (3)
pajuhesh80
I have two other question:
1 - What does
-Wa,-a -Wl,-presetVec=0h,-phi_int_vec=08h,-plo_int_vec=18h
do exactly? I compared .hex file with and without it. When I use it, hex size increases about one line. Is it necessary to use it?

This part:
-Wa,-a
Will cause a single .LST file of all assembly language source files to be saved.
 
 
This has to do with the way that the XC8 tool chain implements the Omniscient Code Generator and optimizations. From what I can understand all the various source code files get compiled to assembly files. These files are linked together then optimized. Then the file is assembled to target object code. The pic-as(v2.20) tool chain appears to be only the last two steps, but leaves out the optimizing.
 
 
This part:
-Wl,-presetVec=0h,-phi_int_vec=08h,-plo_int_vec=18h
Tells the linker what code space address to use for each psect named (resetVec, hi_int_vec, and lo_int_vec).
 
 
pajuhesh80
2 - In project dashboard tab, both program and data memory usages are always 0. I enabled project properties>Loading>Load symbols when ...

The integration of the assembler from the former Hi-Tech company (now owned by Microchip) with the Microchip development environments has always been lame. That the pic-as(v2.20) integration is buggier than a bait store is no big suprise.
 
By now it should be obvious that Microchip has very low motivation to support assembly language development with any of the controllers they sell. The lack of motivation is most pronounced with the 8-bit PICs but seems to apply across the entire product line.
 
It's hard to blame them as the talent entering the work force seem pathologically afraid of assembly language in all forms. Who can they hire for low cost to support (L)user that want to write bare metal code in assembly language?
#15
pajuhesh80
Super Member
  • Total Posts : 88
  • Reward points : 0
  • Joined: 2019/12/08 11:23:37
  • Location: Nowshahr, Mazandaran, Iran
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/01 22:40:53 (permalink)
0
I have an advice: Write all these posts about pic-as as a tutorial and share it somewhere to help anyone who is getting confused by XC8 like me! ;-)
 
dan1138
Who can they hire for low cost to support (L)user that want to write bare metal code in assembly language?

I know they need o lot of hard work, time and money for it but as a leading company, they should keep almost all types of customers happy at any cost! :-)
 
As I said it many times these days, Microchip should learn some things about software from (former)Atmel.
I wonder why they don't use some of good Atmel softwares as they bought Atmel; for example, they could merge this buggy web forum into AvrFreaks which is really better.
Thanks again.
post edited by pajuhesh80 - 2020/07/01 22:57:15

Slow and Steady!
#16
dan1138
Super Member
  • Total Posts : 3731
  • Reward points : 0
  • Joined: 2007/02/21 23:04:16
  • Location: 0
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/02 00:23:38 (permalink)
+1 (1)
pajuhesh80
I know they need a lot of hard work, time and money for it but as a leading company, they should keep almost all types of customers happy at any cost! :-)

I suspect that you may misunderstand the kind of business that Microchip is in.
 
Microchip sells chips, billions of them.
 
They give away software, for the most part.
 
They have very limited motivation to spend any more than the absolute minimum to produce something their customers see as a freebee.
 
The only way I can see the software situation at Microchip changing would be if the only way they could sell chips was to give away better software.
 
The present fad is for embedded development tools to offer code generators to get firmware projects started quickly. To quote Miracle Max: "Don't rush me sonny. You rush a miracle man, you get rotten miracles."
#17
atferrari
Super Member
  • Total Posts : 1448
  • Reward points : 0
  • Joined: 2004/07/08 13:09:24
  • Location: Buenos Aires - Argentina
  • Status: offline
Re: no psect specified for function variable/argument allocation 2020/07/02 04:50:32 (permalink)
0
Without knowing of the change and how it is to be done, after downloading MPLABX 5.40 I learnt that I must download XC8.

Having spent one full day trying to compile my Assembly with it (getting a string of non sensical errors) I tried with pic-as 2.20 that was already there since the beginning.

Agustín Tomás

In theory, there is no difference between theory and practice. In practice, however, there is.

http://cablemodem.fibertel.com.ar/atferrari/
#18
Jump to:
© 2020 APG vNext Commercial Version 4.5