The following have been created (links are here):
- Video
- Blog
- Repository
This week I’m busy with my practicals (I have one tomorrow and one on Saturday), hence I will not be actively coding. Instead,
-
I will be reading up on kernel module and driver implementation on Linux.
-
Coming up with a solid detailed design. (i.e.) what is the best way for different components of the project to interact with each other, whether it is a good idea to have sysfs, what pre-processing should be done before the BotSpeak code is sent to the PRU, how the PRU signals user process and vice versa.)
-
Based on point number 2, come up with an userspace interface (and it’s implementation) for the first iteration of PRU-Speak.
WEEK 3 Update (end of week 2)
What has been done
-
Hacked on panto’s driver
-
Understood the flow of control in upcalls and downcalls.
-
Wrote an “Hello word” program for the PRU with the new compiler.
-
Understood how the code on the PRU must be structured, wrote a C+PRU-Assembly code which handles upcalls/downcalls
-
Modified the original driver and DTS, added features of creation of dev_attr and bin_attr sysfs files.
-
Logic in the sysfs will trigger a downcall to the PRU
Issues
-
The downcall triggers the IRQ handler in the PRU quite successfully, but there is a random problem with the return value while completing the downcall.
-
The overlay once loaded and unloaded can’t be loaded again. [ ‘rmmod’ also fails in a few cases ]
Goals
-
Write driver support so that PRU, kernel can share memory.
-
Export this shared memory to userspace.
-
Make the firmware support some basic BotSpeak instructions. DIO, WAIT etc
-
Talk up with Chris Rodgers, take his input.
Update - End of week 6
What has been done
- Got the timer to work, tried a couple of examples to understand the peripheral better.
- Moved the wait implementation to non blocking.
- Can execute single commands from userspace while running of the script. (via sysfs)
- sysfs entry to Abort an executing script - this is used when one script is to be stopped and a new script is to be loaded.
- Figured out answers to various design problems thanks to two hangouts. Figured how to handle variables, PWM, ADC etc.
Just drew an overall design here : https://drive.google.com/file/d/0B8Pib9n32qUvMzEwdWV2aUpMbGs/
- Exported current state of the PRUSpeak VM to userspace via sysfs - tells me weather the PRU is executing a script or not or just waiting.
- Started working on an shell which Chris can test this weekend. Shell resembles - http://botspeak.org/?page_id=83 (see under step 3 )
Issues
- The timer took some time to figure out. (debugging it is hard)
- The structural design of the userspace infrastructure was a pain. spent 2 days on that - but it was very fruitful
Now I know how to go about giving a nice userspace interface.
Goals (In this particular order)
- Develop the shell which Chris can use.
- IF statements and arithmetic, bit operations.
- Support of variables. [ This will be interesting
]
Update - End of week 7
What has been done
- Developed a TCP (port 6060) server based shell.
- Developed a bash interface to use PRU Speak. PRU can be used now by writing to “/dev/pruspeak”
- Defined an architecture for variable use.
- Instruction set encoding - Done
- Wrote a lexer to start with compiler upgrade.
- Wrote a grammar to use in yacc
Issues
- I’m a bit behind on the Docs as I lost the doc I was writing on (Google Docs has been blocked in India). Have encoding and stuff on paper as of now.
Goals (In this particular order)
- Finish the parser by 9th Jul (Wed)
- Finish the code generation 10th Jul (Thursday)
- Add PRU support for newly generated byte code - 11th Jul (Friday)
- Develop some sample scripts and debug code if necessary - 12 Jul (Saturday)
- Buffer day in case of any problem; otherwise Documentation. - 13 Jul (Sunday)
Now I will have 5 weeks left. General outline plan -
- Develop DIO, PWM libraries. (DTO included)
- Develop AI libraries, mechanism for return values.
- Higher level libraries for SERVO, TONE/Dimming, etc
- Develop a web interface to use PRU Speak.
- Clean scrub code. Make it easier to install etc.
(week 2, 3, 4 will include documentation process in parallel)
Update - End of week 9
What has been done
(This week had a lot of debugging work – a old code showed a few problems which I had to debug)
- Arithmetic inst support added.
- Got 64 bit inst working.
- Return values support.
- Clean userspace interface. Now everything is through Objects and modules.
- Added a shell for the new compiler framework.
- 64 bit support for single instruction. (added new kernel sysfs)
- Conditional ops work.
- Array declaration instruction.
- Array size checks.
- DTS mod to take input. (pru0_r31_14/15)
- Lot of debugging on what I had done in the previous week.
Issues
- Have to figure out “digital in” stuff, I tried out some code, don’t know why it doesn’t work though! ( Still haven’t tried too much )
- Web frontend, I’m not sure as to how Jason plans to go about it. I would need to develop a back end after discussing it with him.
- I have to figure how I will prioritize the stuff I have to do! (plus tiny bugs showing up in my way – eg. I have to treat DIO/PWM etc as special, different kind of size checking. current implementation treats every array the same, this breaks things that are working)
Goals
- PWM support
- AI support
- Global pin control.
You might want to change your Subject: line to show that 