Co-Pine-ON, Boot co-processor assistant
#1
Lightbulb 
Hi, just want to share a little idea (already tested) that I am using to 'assist' my Pine64+ board to boot...

My Pine64 has some kind of boot problem, it only run normally somewhere around 30% of the time (out of 10 times, only 3 boot is successful), perhaps a little more or little less...

Unable to understand the problem to try a correction, I had the idea of putting a microcontroller to issue a hardware-reset to the Pine64, every time that the Pine does not boot normally...

Well, the first prototype is working, need some fine tunning and improvements but the overall idea works...
[Image: pine64-drawing-v8-copineON-p1.jpg]


[Image: co-pine-on-photo-zoom-small.jpg]

For the moment, this is the only "stable" way I found to solve the boot issue I am having with my Pine64, and since I want to test/use/learn more this 64bit hardware with 64bit OS, it will be the *solution* for while...

The whole thing is documented and all the files are available:
HOWTO:
http://www13.plala.or.jp/pskitty/copineon.html

GitHub files:
https://github.com/valterfukuoka/copineon

Not a really good solution for people who have the same problem but can help depending on the reasons and goals in mind...

Regards all,
Valter
  Reply
#2
Love your work... this is exactly what this forum is all about... sharing solutions to problems we've had with others. It certainly ended up neater than I expected it would! Wink

When looking at the next revision of your code, feel free to reuse anything from pine64-SYSLED-heartbeat.sh that you find helpful. It will work as a regularly logged in user, with the following provisions:

In /etc/rc.local, the following (as it needs to be re-applied every boot):
chown -R root:gpio /sys/class/gpio
chmod -R ug+rw /sys/class/gpio

Then the normally logged in user must be in the gpio group i.e.
sudo adduser gpio
sudo usermod -aG gpio your-user-name

I'm intending in the future to make a systemd service version of it so that the /etc/rc.local mods aren't needed. 

Also, a comment at the top of your PIC source to indicate that it is for the PIC12F1501 Wink

EDIT: I also meant to say I'm also eager to hear more about your PICKLY Google Blockly work, as it looks like a great way to get started with PIC programming. Whilst not strictly pine64 related, it deserves future mention here as Google Blockly can also export PHP and Python code, which would be a great starting place for newcomers! Wink
  Reply
#3
(06-25-2017, 06:29 PM)pfeerick Wrote: ... It certainly ended up neater than I expected it would! Wink

When looking at the next revision of your code, feel free to reuse anything from pine64-SYSLED-heartbeat.sh that you find helpful. It will work as a regularly logged in user, with the following provisions:

In /etc/rc.local, the following (as it needs to be re-applied every boot):
chown -R root:gpio /sys/class/gpio
chmod -R ug+rw /sys/class/gpio

Then the normally logged in user must be in the gpio group i.e.
sudo adduser gpio
sudo usermod -aG gpio your-user-name

I'm intending in the future to make a systemd service version of it so that the /etc/rc.local mods aren't needed.

I am, at least, 2 times surprised myself... this little exercise "told me" a lot about this core-independency and why, perhaps, we should look more at it... not exactly to solve problems, instead to have one mechanism to run code...

2nd: Instead of using 2 pins to talk to the MCU, there is also a possibility to use 1 pin serial communication from the Pine to the MCU, using soft-serial inside the MCU, so that we can send/receive not only ON/OFF but instead, lots of different messages. The serial comm mechanism can inform at what point in the boot the Pine is, giving a better understanding about the whole thing.

I will look at your code, since I need to have, if not the "official" way to access GPIO, at least one that is more correct than the lines that I am using...

Using the Co-Pine-ON MCU, it is also possible to "manage" the POWER-ON button (I think), if so, we can have more elaborated mechanisms, other than just *switch on* thing... I had this thinking at the beginning, perhaps it is also worth enough to implement it...


(06-25-2017, 06:29 PM)pfeerick Wrote: Also, a comment at the top of your PIC source to indicate that it is for the PIC12F1501 Wink

Thanks for pointing this...
This is my (PICKLY) fault... should have this line inside the code...
Version 1 of PICKLY was entirely created around 12F1501 and 16F1503...
A version 2 and plus will be able to handle different MCU targets...


(06-25-2017, 06:29 PM)pfeerick Wrote: EDIT: I also meant to say I'm also eager to hear more about your PICKLY Google Blockly work, as it looks like a great way to get started with PIC programming. Whilst not strictly pine64 related, it deserves future mention here as Google Blockly can also export PHP and Python code, which would be a great starting place for newcomers! Wink

FIRST: Yes, I agree with you about Blockly.
It is a powerful tool to help beginners, but also, I think, a powerful too for the casual coder (I mean, people that from time to time will use/benefit from coding)...
As you said, 'no direct connection to Pine'... but, if instead we take Pine64 as a *computer board*, then, it is not a bad idea to promote both uses in relation to coding... 1 plus 1, in this case, could result in more than 3... lol...

PICKLY: After finishing a "version 1", at least in my oppinion, Blockly has lot to offer, and I like to repeat that IT IS NOT ONLY for beginners, also for the CASUAL coder...
Blockly is relative easy to adapt/change, so, any idea that appears find easy way to code... the only problem is that, each idea implicates in MANY lines of new code... the task of creating the code is relative easy and simple, the VOLUME is the concern... you face a choice between keep adding ideas or making it as minimalist as possible... and BOTH OPTIONS seems cool... !?!?

About Visual Block Programming:
Blockly represent a "jump" on the concept, and still evolving, perhaps another "jump" is possible, or near, and we will be all making use of this "blocks" in every day life...

Valter

PS. Let's also mention that Blockly also generate Javascript...
  Reply
#4
(06-25-2017, 06:29 PM)pfeerick Wrote: EDIT: I also meant to say I'm also eager to hear more about your PICKLY Google Blockly work, as it looks like a great way to get started with PIC programming. Whilst not strictly pine64 related, it deserves future mention here as Google Blockly can also export PHP and Python code, which would be a great starting place for newcomers! Wink

Speaking of Blockly and Pine possible connection...

I almost miss to mention MIT App Inventor (which uses Blockly) to create Android Apps...

So, depend on the perspective, THERE IS A CONNECTION, and it is 2x, it's TWIN...

Since Pine runs Android, Blockly can be THE WAY to help users to create their own Android Apps!

Considering that Android SDK (Java) may require some time for the beginner to start with it, AppInventor can "bridge" that road with simplicity and elegance, motivating even further the candidate to proceed and reach the Java level (Android Studio [SDK])...

http://appinventor.mit.edu/explore/


Valter
  Reply
#5
(06-26-2017, 08:46 PM)ecolezen Wrote: So, depend on the perspective, THERE IS A CONNECTION, and it is 2x, it's TWIN...

He he... I knew it wouldn't be long before at least someone would mention the android connection Wink

Yes, GUI programming is great for beginners and casual programmers, or even just when you want to slap something quick or simple together, or make the initial skeleton.

I like your idea of a re-using the serial comms on the pine64 for startup diagnostics. I'd be tempted to use it anyway, because if you extent the functionality of the MCU as I think you plan to, you could also use the serial link to control it's IO pins for other stuff. Or just use it as a dedicated power and startup status indicator. Oh the possibilities Wink
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
Photo Pine A64+ from Kick starter running Pi-Hole netHolio 0 84 12-02-2019, 09:36 PM
Last Post: netHolio
  Boot from HDD via usb BnEc 1 62 11-29-2019, 04:39 AM
Last Post: evilbunny
  Pine A64+ vs LCD do not boot DDS 2 54 11-25-2019, 11:44 AM
Last Post: tllim
  NetBSD for Pine A64(+) Luke 3 1,083 10-05-2019, 11:04 PM
Last Post: mrgtwentythree
  Can anyone run Boinc on Pine models? MarijusR 6 271 09-11-2019, 06:41 AM
Last Post: letarg
  There is a usable distro for Pine A64? polv89 6 2,007 06-09-2019, 03:32 PM
Last Post: dkebler
  Pine A64 stuck in boot process joey 1 236 05-28-2019, 09:07 PM
Last Post: joey
  Won't power on/boot -- kickstarter A64 2GB fuzzycuffs 3 1,114 02-22-2019, 03:25 AM
Last Post: GaryFunk
  dead Pine A64? Truglio 2 450 01-22-2019, 10:06 AM
Last Post: Truglio
  I2S Codec on Euler bus of Pine A64+ RANJITT76 8 1,163 01-17-2019, 02:25 AM
Last Post: ramstadt

Forum Jump:


Users browsing this thread: 1 Guest(s)