π
<-
Chat plein-écran
[^]

Update on developing an SDK for the CASIO fx-CP400

Nouveautés, projets, mises à jour.

Update on developing an SDK for the CASIO fx-CP400

Message non lude The6P4C » 19 Avr 2018, 01:03

Hi everyone,

Just wanted to post a bit of an update on my progress in developing an SDK for the CASIO fx-CP400. This is after I've managed to achieve code execution on the calculator after dumping the firmware and adding a small stub to allow me to run code in a file placed on the calculator's USB storage (the one that appears when you press "USB Flash" when a USB cable is plugged in). If you haven't seen them already, I made a couple blog posts on dumping the firmware and adding a small proof-of-concept modification to show arbitrary code execution. They're below if you want to have a read.

Hacking the fx-CP400 - Part 1 (Getting the Firmware)
Hacking the fx-CP400 - Part 2 (Exploring the Firmware)

Now, onto the progress I've made at developing some sort of SDK for the calculator. Since the calculator lacks any sort of add-on feature, it's first necessary to install a small code stub somewhere in the firmware which can load an executable file into memory and run it. Right now, I've placed this in the System app, under the System > Imaginary Unit menu in the menu bar at the top. This isn't really that important - it's just because it was somewhere I knew the function wouldn't get called when I didn't want it to, and didn't get in the way of any other important OS functions. At the moment, when the Imaginary Unit menu option is pressed, a file run.bin is loaded from the calculator's flash, placed into a (I think) unused section of RAM, and jumps straight to it. This gives me a super easy way to write some code, put it on the calculator, and run it, without having to reflash the whole firmware (which takes >5 minutes....).

Since the calculator doesn't seem to support any type of add-on, it appears to lack a syscall interface. As such, system functions are called directly by their address. So my battle has been sorting through functions in the firmware, finding which are actually useful/won't break the calculator and then documenting them to the best of my ability.

At the moment, I am able to write text to the screen (through functions used in the debug menu/unrecoverable system errors), write directly to the VRAM (set the value of pixels and refresh the LCD), get input (key and touch events) - albeit in a slightly broken way, and do some very minimal GUI stuff.

Here's some proof of being able to write to the VRAM and a slightly broken GUI demo (which I've since fixed)


Goals before I make any kind of release: find a nicer way to start arbitrary code execution. At the moment I'm investigating how the menu (the one with the application icons) is populated, in an attempt to add my own icon for add-on applications. Intent would be to have that launch a browser, where the user can select an executable file to load. Obstacles to this are that testing any modifications to the firmware involves reflashing the calculator, which is a pretty lengthy process as I said above, and having to discover exactly how each of the applications on the menu are implemented.

I started to have issues around that recently (since I don't currently have much of an idea on how each application is started and executed) when I was testing touch screen input. Tapping a point on the screen reports an event with one code, and tapping an icon on the bar at the bottom of the touch screen reports a different code depending on which button is pressed. Issue is - tapping the Menu or Main keys return a structure I haven't figured out the format of at all, and after my code finishes execution the calculator locks up. When I get all this worked out, I'll be much happier to make some sort of release :)

If anyone's got any questions, fire away.
Avatar de l’utilisateur
The6P4CProgrammeur
Niveau 2: MI2 (Membre Initié)
Niveau 2: MI2 (Membre Initié)
Prochain niv.: 20%
 
Messages: 3
Inscription: 02 Fév 2018, 06:44
Localisation: Brisbane, Australia
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile
YouTube: The6P4C
Twitter/X: The6P4C
GitHub: The6P4C

Re: Update on developing an SDK for the CASIO fx-CP400

Message non lude Lionel Debroux » 19 Avr 2018, 07:01

Good to see progress on that front :)

This gives me a super easy way to write some code, put it on the calculator, and run it, without having to reflash the whole firmware (which takes >5 minutes....).

Yeah, that saves a lot of time. 5-10' testing cycles are no fun...

Since the calculator doesn't seem to support any type of add-on, it appears to lack a syscall interface. As such, system functions are called directly by their address. So my battle has been sorting through functions in the firmware, finding which are actually useful/won't break the calculator and then documenting them to the best of my ability.

You're describing the painful process which many third-party developers went through, for making third-party SDKs targeting closed platforms for which the manufacturer provides zero documentation and will to provide a SDK (syscall interface, etc.). The Nspire belongs to that category, too. The fact that its OS is based on Nucleus helped a bit, but still - many pieces are full-custom.

[EDIT: and like the two persons who posted after me, I can't see the images either. It's not unusual, and one of the causes of such behaviour is that some hosting sites don't like anti-ad and/or anti-tracking technologies.]
Membre de la TI-Chess Team.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
Avatar de l’utilisateur
Lionel DebrouxSuper Modo
Niveau 14: CI (Calculateur de l'Infini)
Niveau 14: CI (Calculateur de l'Infini)
Prochain niv.: 11.2%
 
Messages: 6858
Inscription: 23 Déc 2009, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: -
GitHub: debrouxl

Re: Update on developing an SDK for the CASIO fx-CP400

Message non lude Ti64CLi++ » 19 Avr 2018, 19:27

I can't see the two pictures. Is it normal?
Good job anyway :bj:
Image
Avatar de l’utilisateur
Ti64CLi++Modo
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 32.3%
 
Messages: 3441
Images: 75
Inscription: 04 Juil 2014, 14:40
Localisation: Clermont-Ferrand 63
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: ENS Rennes
GitHub: Ti64CLi

Re: Update on developing an SDK for the CASIO fx-CP400

Message non lude parrotgeek1 » 19 Avr 2018, 20:34

Ti64CLi++ a écrit:I can't see the two pictures. Is it normal?
Good job anyway :bj:

i cant either
Avatar de l’utilisateur
parrotgeek1Programmeur
Niveau 11: LV (Légende Vivante)
Niveau 11: LV (Légende Vivante)
Prochain niv.: 88%
 
Messages: 745
Inscription: 29 Mar 2016, 01:22
Localisation: This account is no longer used.
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: Update on developing an SDK for the CASIO fx-CP400

Message non lude The6P4C » 20 Avr 2018, 09:03

Hmm, I'll upload them to Imgur just in case the fact that they're on Google Photos is breaking them. Try this.

Avatar de l’utilisateur
The6P4CProgrammeur
Niveau 2: MI2 (Membre Initié)
Niveau 2: MI2 (Membre Initié)
Prochain niv.: 20%
 
Messages: 3
Inscription: 02 Fév 2018, 06:44
Localisation: Brisbane, Australia
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile
YouTube: The6P4C
Twitter/X: The6P4C
GitHub: The6P4C

Re: Update on developing an SDK for the CASIO fx-CP400

Message non lude Adriweb » 20 Avr 2018, 12:48

(I fixed the album bbcode (imgur broke it themselves...), but the imgurthumb one works fine)
Image

MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)
Avatar de l’utilisateur
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 80%
 
Messages: 14599
Images: 1216
Inscription: 01 Juin 2007, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Twitter/X: adriweb
GitHub: adriweb

Re: Update on developing an SDK for the CASIO fx-CP400

Message non lude Nemhardy » 23 Avr 2018, 17:48

Wow, that's quite impressive! :D
Now I'm definitely keeping my CP400 by my side, and looking forward to see where this stuff will bring us!
Je maintiens le portage d'Eigenmath pour les Casio monochromes, n'hésitez pas à y jeter un œil si ça vous intéresse ! :p
Avatar de l’utilisateur
NemhardyPremium
Niveau 8: ER (Espèce Rare: nerd)
Niveau 8: ER (Espèce Rare: nerd)
Prochain niv.: 48%
 
Messages: 45
Inscription: 28 Déc 2014, 22:06
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: Update on developing an SDK for the CASIO fx-CP400

Message non lude Cakeisalie5 » 23 Avr 2018, 19:09

Quite cool! Looking forward as well to see how that turns out :)
Avatar de l’utilisateur
Cakeisalie5Partenaire
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 66.9%
 
Messages: 49
Inscription: 18 Juin 2016, 17:56
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: Politique
Twitter/X: thecakefive

Re: Update on developing an SDK for the CASIO fx-CP400

Message non lude Ti64CLi++ » 24 Avr 2018, 16:37

Definitely cool !!! :bj:
Like Nemhardy, I'll keep my fx-CP 400+E (even if I wanted to sell it :D) ;)
Image
Avatar de l’utilisateur
Ti64CLi++Modo
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 32.3%
 
Messages: 3441
Images: 75
Inscription: 04 Juil 2014, 14:40
Localisation: Clermont-Ferrand 63
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: ENS Rennes
GitHub: Ti64CLi

Re: Update on developing an SDK for the CASIO fx-CP400

Message non lude shokifrend77 » 19 Mai 2021, 21:23

Hello, is there any update on the SDK?
Avatar de l’utilisateur
shokifrend77
Niveau 0: MI (Membre Inactif)
Niveau 0: MI (Membre Inactif)
Prochain niv.: 0%
 
Messages: 1
Inscription: 19 Mai 2021, 21:20
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile


Retourner vers Actualités

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 2 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
Phi NumWorks jailbreak
123
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
782 utilisateurs:
>753 invités
>25 membres
>4 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)