New to ChipKIT Pi

sethkush
Posts: 9
Joined: Thu Mar 05, 2015 5:58 am

Re: New to ChipKIT Pi

Post by sethkush » Sun Mar 08, 2015 7:03 am

pic32prog fails without giving an error. Avrdude gives the following error now:

Code: Select all

avrdude: error at /home/seth/.uecide/cores/chipkit/tools/linux_arm/avrdude.conf:2241: must specify page_size for paged memory
The problem is at the end of the PIC32MX250F128B section, so I figured it would be best not to delete it.

nroff-man
Posts: 40
Joined: Wed Oct 01, 2014 6:05 pm

Re: New to ChipKIT Pi

Post by nroff-man » Sun Mar 08, 2015 5:13 pm

Hi

I have no idea what your problem is but are you pressing
the BOOTLOAD-EN button and then toggling RESET?

Do you have permission to access the serial port?

Did you disable the serial port in inittab? (does slackware
enable it?)

BTW, I have created a HEX file that you can test:
http://dev.kewl.org/misc/hex/mx250_ckpi.hex

Download this and show us what happens when you type:

Code: Select all

pic32prog -d /dev/ttyAMA0 mx250_ckpi.hex
It should come up something like:

Code: Select all

pic32prog -d /dev/ttyAMA0 mx270_ckpi.hex 
Programmer for Microchip PIC32 microcontrollers, Version 2.0.9986ac0
    Copyright: (C) 2011-2015 Serge Vakulenko
      Adapter: STK500v2 Bootloader
 Program area: 1d000000-1d07ffff
    Processor: Bootloader
 Flash memory: 512 kbytes
  Boot memory: 12 kbytes
         Data: 55880 bytes
        Erase: done
Program flash: ######################################################### done
 Verify flash: ######################################################## done
Rate: 2933 bytes per second
Bye

sethkush
Posts: 9
Joined: Thu Mar 05, 2015 5:58 am

Re: New to ChipKIT Pi

Post by sethkush » Tue Mar 10, 2015 5:37 am

pic32prog seems to be segfaulting. I made sure the necessary libraries were installed, and it still wouldn't run. Strace shows that it happens just after a call to getrlimit():

Code: Select all

getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
I tried to compile my own binary from the git repo, but make failed because 'uint16_t' was undeclared in one of the source files.

nroff-man
Posts: 40
Joined: Wed Oct 01, 2014 6:05 pm

Re: New to ChipKIT Pi

Post by nroff-man » Tue Mar 10, 2015 7:04 am

hi
sethkush wrote:pic32prog seems to be segfaulting. I made sure the necessary libraries were installed, and it still wouldn't run. Strace shows that it happens just after a call to getrlimit():

Code: Select all

getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
I tried to compile my own binary from the git repo, but make failed because 'uint16_t' was undeclared in one of the source files.
A missing uint16_t definition tells us that #include <stdint.h> is not
being included on your platform, you could try adding that to the
offending file(s).

This is how I build pic32prog for the raspberry pi running raspbian:
http://wiki.kewl.org/dokuwiki/tools:pic32prog
You may need to solve these dependencies for slackware first.

If none of this works, you could ultimately try my own hex loader.
which is part of this project:
http://wiki.kewl.org/dokuwiki/projects:pickle

Using my own tools you can at least check that things are running.

To program the example hex file you would type:

Code: Select all

pload program /dev/ttyAMA0 mx250_ckpi.hex 24
If you are curious, the hex file is this:
http://wiki.kewl.org/dokuwiki/projects:ape65

Bye-bye

edit:typo

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: New to ChipKIT Pi

Post by majenko » Tue Mar 10, 2015 11:40 am

sethkush wrote:pic32prog seems to be segfaulting. I made sure the necessary libraries were installed, and it still wouldn't run. Strace shows that it happens just after a call to getrlimit():

Code: Select all

getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
I tried to compile my own binary from the git repo, but make failed because 'uint16_t' was undeclared in one of the source files.
Can you run it under GDB? Get some idea of the back trace then - see just what's causing it.

There is no mention of getrlimit() in the source, so it must be coming from a library, which means the library function may not be being called right, which means we need to know what is calling it - and that may be three or four functions higher in the chain.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

sethkush
Posts: 9
Joined: Thu Mar 05, 2015 5:58 am

Re: New to ChipKIT Pi

Post by sethkush » Wed Mar 11, 2015 12:58 am

pload worked. The 6502 simulator is really cool. I'm afraid I'm not very well versed in gdb, and I wasn't able to get anything useful from it. Adding "#include <stdint.h>" fixed the uint_16_t problem. Unfortunately, the build still fails because ld can't find "-lusb-1.0" which is odd, because when I run simply "ld -lusb-1.0" it does seem to find it and it's dependencies.

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: New to ChipKIT Pi

Post by majenko » Wed Mar 11, 2015 1:19 am

If you prefix the pic32prog command with:

Code: Select all

gdb --args pic32prog .... etc ...
Then when gdb loads, press "r" and return to run the program. When it crashes, enter "bt" and press return. Copy the output to here.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

sethkush
Posts: 9
Joined: Thu Mar 05, 2015 5:58 am

Re: New to ChipKIT Pi

Post by sethkush » Wed Mar 11, 2015 1:22 am

here is a printout:

Code: Select all

Starting program: /home/seth/.uecide/cores/chipkit/tools/linux_arm/pic32prog
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x000593c2 in flash_data ()
(gdb) bt
#0  0x000593c2 in flash_data ()
#1  0x0000a30a in _start ()

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: New to ChipKIT Pi

Post by majenko » Wed Mar 11, 2015 1:33 am

That doesn't look good... It thinks it's executing a function flash_data(), but that is an array, not a function...!

My guess is that the whole execution of the debian compiled version is going completely awry on slackware. So you need a slackware specific one... Maybe I should crack out my old V1 Pi and see about trying slackware on it...
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

sethkush
Posts: 9
Joined: Thu Mar 05, 2015 5:58 am

Re: New to ChipKIT Pi

Post by sethkush » Wed Mar 11, 2015 1:40 am

That's kind of interesting. I wonder what could possibly cause this kind of incompatibility.

Post Reply