picprojects.net Forum

picprojects.net Forum
It is currently Wed May 23, 2018 12:59 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Raspbian: did a newer kernel than 4.4 break PICPgm?
PostPosted: Thu Apr 26, 2018 5:06 pm 
Offline

Joined: Thu Mar 17, 2016 12:25 pm
Posts: 5
Hello, I've been using PICPgm with a Raspberry Pi 2 on Raspbian for a while and it has worked reliably. But I haven't updated the system in a long time, and after "apt-get upgrade" I can't get PICPgm to work at all. The RP IO's are still in the config file, the symlink is set up and nothing there has changed. (Edit: I had also tried the latest picpgm-2.9.3.0-linux-armhf.tar.gz but it doesn't make a difference.)


On the backup with kernel 4.4.13-v7+ everything works as expected:

==================================================================
PICPgm 2.9.0.0
PIC Development Programmer, http://picpgm.picprojects.net
Copyright 2002-2016 Christian Stadler (picpgm@picprojects.net)
built on Mar 20 2016, 20:39:54
==================================================================

GPIO access via /dev/mem, base address 0x3F200000
Programmer: GPIO Programmer (Raspberry Pi)
at GPIO

Autodetecting PIC ...

PIC name: PIC16F1578
Device ID: 0x3002
Flash: 8 kByte
EEPROM: 0 Byte
CalWord1: 0x31B0
CalWord2: 0x19E7

Erasing whole device ... done!
Programming Code Memory 0x00000270
Verifying Code Memory 0x0000026E => Code memory OK!
Programming Data Memory 0x00000000
Verifying Data Memory 0x00000000 => Data memory OK!
Programming Config Memory 0x00000012
Verifying Config Memory 0x00000012 => Config memory OK!

finished in 9.0 seconds!



After upgrading to 4.9.35-v7+ it's not working:

==================================================================
PICPgm 2.9.0.0
PIC Development Programmer, http://picpgm.picprojects.net
Copyright 2002-2016 Christian Stadler (picpgm@picprojects.net)
built on Mar 20 2016, 20:39:54
==================================================================

GPIO access via /dev/mem, base address 0x20200000
Error! PIC Programmer not found! Check connection!


One weird thing is the different address in /dev/mem between the two. Any ideas?


Top
 Profile  
 
 
 Post subject: Re: Raspbian: did a newer kernel than 4.4 break PICPgm?
PostPosted: Mon May 07, 2018 7:11 pm 
Offline

Joined: Fri Oct 28, 2011 5:18 pm
Posts: 222
Hi Marchello,

PICPgm uses /proc/cpuinfo for detection of the CPU and the corresponding GPIO base address.
Maybe something in the file format changed with the new kernel which fools PICPgm.

Could you please post the /proc/cpuinfo before and after the update?

Anyway, PICPgm also supports the GPIO driver which is CPU independend, but currently priority is given to memory mapped GPIO access if a suppored CPU is identified.
I'll try to compile a version which uses GPIO driver in general (at the beginnig the direct memory mapped GPIO access was faster, but with some some changes in PICPgm programming speed is nearly the same, even with the GPIO driver).

Regards,
Christian


Top
 Profile  
 
 Post subject: Re: Raspbian: did a newer kernel than 4.4 break PICPgm?
PostPosted: Tue May 08, 2018 9:14 am 
Offline

Joined: Thu Mar 17, 2016 12:25 pm
Posts: 5
Thanks for looking into it, sounds like you already have a good solution in mind.
But it looks like we're on to something here, too: the new kernel identifies the CPU differently! I have not changed anything other than the SD card.

Kernel 4.4.13-v7+:
$ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5
[Processor information repeats identically for each core...]

Hardware : BCM2709
Revision : a01041
Serial : 000000008c697777


Kernel 4.9.35-v7+:
$ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 5
[Processor information repeats identically for each core...]

Hardware : BCM2835
Revision : a01041
Serial : 000000008c697777

A quick search brought up the following topic: https://raspberrypi.stackexchange.com/q ... es-bcm2835
I guess they changed which nomenclature (family vs. model) is exposed... this might complicate things a bit. I remember that I'm using newer and older RasPi 2's, and the newer ones have BCM2836 chips.


Top
 Profile  
 
 Post subject: Re: Raspbian: did a newer kernel than 4.4 break PICPgm?
PostPosted: Thu May 17, 2018 4:47 pm 
Offline

Joined: Fri Oct 28, 2011 5:18 pm
Posts: 222
Hi Marchello,

I haven't seen that you use an old version of PICPgm.
If have forgotten that I already did the change I wanted to do in picpgm 2.9.3.0.

Download the latest version here, I assume this will solve your problem:
http://picpgm.picprojects.net/download/ ... mhf.tar.gz

Regards,
Christian


Top
 Profile  
 
 Post subject: Re: Raspbian: did a newer kernel than 4.4 break PICPgm?
PostPosted: Fri May 18, 2018 7:44 am 
Offline

Joined: Thu Mar 17, 2016 12:25 pm
Posts: 5
Hello Christian! I thought I had tried the newer version, but you're right. Just tested it again and it works... I think I got the binaries mixed up or didn't actually execute the new version when testing. (Edit: I've probably neglected the pin settings in the config file.)

Thanks for your help! I hope the information about the reporting differences in the new kernel is helpful regardless.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group