Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:20 22 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Compiling source code

Author Message
Gadget
Regular Member

Joined: 22/06/2011
Location: Australia
Posts: 70
Posted: 02:59am 24 Jun 2011
Copy link to clipboard 
Print this post

Has anyone else tried to compile the source code?

I have been attempting to add some extra functionality to the firmware of these little beasts, but am having some difficulty with getting a fully working firmware.

I have setup set up mplab, C32 compiler, linker etc as per the instructions included in the source code (ref: comments at the start of main.c)

I can get the code to compile (albeit with a few compiler warnings, as mentioned by Geoff), the code successfully loads via the usb cable (note, I also included pins to the ICSP section and due to the layout my Pick Kit 3 does not fit )

Powering the board back up I can connect via the USB, and all appears to work, but when I connect using a keyboard and monitor, the picture is fine but the keyboard does not respond correcty. I can get the keyboard to work if I type really slowly and hold each key down longer than would be expected.
It looks almost like a timing issue, and I have tried using Geoff's source codes without any modifications (and I have tried all versions of the source).

Has anyone else tried this? and if so what results?

Thanks in advance

Terry

 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 05:41am 24 Jun 2011
Copy link to clipboard 
Print this post

Gadget, what version of the source code are you running?

Stuart
Time is nature's way of keeping everything from happening all at once.
 
Gadget
Regular Member

Joined: 22/06/2011
Location: Australia
Posts: 70
Posted: 06:10am 24 Jun 2011
Copy link to clipboard 
Print this post

Stuart,

I have tried all versions 2.1 to 2.4 and all have the same result, im guessing I have one setting wrong for it to compile not quite right

Terry
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 06:18am 24 Jun 2011
Copy link to clipboard 
Print this post

I haven't tried to compile the source as my C is exceptionally rusty. I'd like to implement a few things but I'm not sure that I'm up to it at the moment. Would you like me to try a compile and burn to verify your results?

Stuart
Time is nature's way of keeping everything from happening all at once.
 
Gadget
Regular Member

Joined: 22/06/2011
Location: Australia
Posts: 70
Posted: 06:42am 24 Jun 2011
Copy link to clipboard 
Print this post

Stuart, could you give it a go and let me know how you get on.
I just used the source from Geoff's site, unmodified just to make sure I wasnt introducing errors.

for info I'm using MPLAB 8.63 and C32 V 1.11B ( I think there are updated versions of both out now)

Terry
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 07:06am 24 Jun 2011
Copy link to clipboard 
Print this post

I'm running MPLAB 8.70, just installing C32 1.12a. I probably wont get an opportunity to do it tonight though.

Stuart
Time is nature's way of keeping everything from happening all at once.
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 07:12am 24 Jun 2011
Copy link to clipboard 
Print this post

I've tried to download the latest source and it appears that Geoff's site is down so I cant get the source at this point.

grrrrrrr
Time is nature's way of keeping everything from happening all at once.
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 07:36am 24 Jun 2011
Copy link to clipboard 
Print this post

I've just tried a build and I'm getting a whole lot of these.

undefined reference to `strcasecmp'

and the build fails.

Stuart
Time is nature's way of keeping everything from happening all at once.
 
Jimbo

Newbie

Joined: 20/06/2011
Location: Australia
Posts: 8
Posted: 09:47am 24 Jun 2011
Copy link to clipboard 
Print this post

Hi,

I have had the same problem.

I downloaded the source code from the Web Page, and am trying to compile with MPLAB version 8.70, and MPLAB C32 Lite Version 1.12. I have tried all versions from V2.2 to V2.4, however I receive compile errors concerning the following two functions.

/* BSD library functions */
int strcasecmp (const char *s1, const char *s2) and
int strncasecmp (const char *s1, const char *s2, size_t n)

I notice that these functions are not included in the MPLAB C32 pic32-libs\string.h file, but are infact defined in the pic32-libs\lega-c\string.h file. So ultimately my build fails with a unresolved reference for these functions.

I have overcome the problem, by adding my own implementation for these two functions to the source code (See attached file), but thought there might be an easier way. Compiler option or something to use these lega-c paths and libs instead.

Any suggestions or comments would be appreciated.

2011-06-24_192943_BSDFunctions.zip

In the mean time, I have made a few minor changes to the firmware.

1) I have implemented Graphics Characters for CHR$(128) to CHR$(191) this give compatability for the TRS-80 / System-80 Basic Character set.

2) I added a few extra alias for some of the existing command. Again to give better compatability with the TRS-80 / System-80, (SET,RESET,POINT)

3) I extended the keyboard scanning to detect and report some of the PS/2 Extended key codes, (i.e. for the Arrorw keys etc)

4) I changed the way the cursor was implemented, so it was possible to display the cursor under a character, and not instead of.

5) I also wanted to be able to flash the screen very quickly, so I extended the CLS command to take an optional argument. 'CLS 1' for fill with White, and 'CLS 2' to invert the screen.

6) I added Bitwise Left and Right Shift operators (1 << 2) ==4 and (4 >> 2) == 1

7) And lastly I could not resist after I saw it listed here, I changed the prompt to match the TRS-80/SYSTEM80

READY
>_

See attached screen shots.


Regards

Jimbo.



Now the inverted video.


 
Gadget
Regular Member

Joined: 22/06/2011
Location: Australia
Posts: 70
Posted: 01:34pm 24 Jun 2011
Copy link to clipboard 
Print this post

I got mine to compile sucessfully without any changes, just that the keyboard didnt work properly

 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 03:02pm 24 Jun 2011
Copy link to clipboard 
Print this post

I've realised what is happening, but I cant find how to fix it. It appears to be compiling with the wrong toolsuite. I cant work out how to make it compile with the MPLAB C32 rather than the Microchip PIC32 C Compiler toolsuite.

Stuart
Time is nature's way of keeping everything from happening all at once.
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 03:49pm 24 Jun 2011
Copy link to clipboard 
Print this post

  stuarts said   I've realised what is happening, but I cant find how to fix it. It appears to be compiling with the wrong toolsuite. I cant work out how to make it compile with the MPLAB C32 rather than the Microchip PIC32 C Compiler toolsuite.

Stuart


I'll bet Geoff knows.

Cheers Don...
https://www.dontronics.com
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 09:08am 25 Jun 2011
Copy link to clipboard 
Print this post

I'll bet he does too. its strange. I let MPLAB install C32 when I installed it. now that I've installed 1.12, then read Geoff's readme that says it doesn't compile with anything past 1.11b, I've installed that, but MPLAB doesn't seem aware of the upgrade. it installs in a different location. having problems getting MPLAB to recognise it.

Stuart
Time is nature's way of keeping everything from happening all at once.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 12:02pm 25 Jun 2011
Copy link to clipboard 
Print this post

Hi Folks,

I am on a bad connection so I will keep it short. The source will NOT compile correctly with anything other than ver 1.11b. I don't know what the problem is and it will be some time before I can fix it. In the meantime 1.11b does an excellent job. The README with the source contains an URL pointing to where you can download it.

The problem with the keyboard could be because of the wrong level of optimisation. I have tested levels 1 and 2 but I believe the others will give a problem (the lite version will only compile at level 1 but that is fine).

If you make changes to the source, try to make them modular so that it will be easy for you to retrofit them to later versions produced by me. I cannot see any large structural changes in the future so retrofitting should be easy.

Geoff
Geoff Graham - http://geoffg.net
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 12:44pm 25 Jun 2011
Copy link to clipboard 
Print this post

Thanks for the update Geoff, as it is I just managed to get a compile to succeed. it seems I had to install the C compiler before MPLAB. Otherwise it was looking for the wrong compiler. I've compiled with 1.11b and it all seems good. The PS2 keyboard is working fine. No issues with slowness.

Gadget, that was with MPLAB 8.70 and MPLAB C32 1.11b.

StuartEdited by stuarts 2011-06-26
Time is nature's way of keeping everything from happening all at once.
 
Gadget
Regular Member

Joined: 22/06/2011
Location: Australia
Posts: 70
Posted: 02:01pm 25 Jun 2011
Copy link to clipboard 
Print this post

Success!!!
Thanks Geoff, thats what I was missing the optimiser settings used level 1, now works perfectly.

now to implement a few changes (peek and poke to video memory)


Terry
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 12:50am 26 Jun 2011
Copy link to clipboard 
Print this post

Geoff, just wondering if you are using the time limited evaluation and since you have been doing this for more than the 60 days limit, what you are doing when the evaluation runs out.

Stuart
Time is nature's way of keeping everything from happening all at once.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 03:42am 26 Jun 2011
Copy link to clipboard 
Print this post

Up to date all I have done all development using the Lite version (level 1 optimisation). If I want level 2 optimisation for a public release I just install the compiler in a virtual machine and use it in the time limited mode. If the time limit runs out I just use a new virtual machine.

Geoff
Geoff Graham - http://geoffg.net
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 05:25am 26 Jun 2011
Copy link to clipboard 
Print this post

Thanks Geoff, I've used that technique before and it never occurred to me this time.

Stuart
Time is nature's way of keeping everything from happening all at once.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024