If you get None back, it means you didn’t get any serial data back from the target. My guess is that either get_pt is never being called at all or EccPoint_multi is crashing. If you move the trigger_high() call back before your Ecc call, then do the following in Python:
do you see False printed? If not, it means your firmware isn’t reaching get_pt. Otherwise, I’d guess EccPoint_multi is crashing.
Unfortunately, a PC and an embedded device are very different, so C code that runs fine on one may not run on the other.
I have seen the print “False”, so, I guess it is crashing.
But now I have another question, what reasons will lead a crashing? I wrote this code all in C code, without any asm about platform. And after days of try, I can’t find a solution for that, I guess maybe there is a problem like stackoverflow, is it reasonable?
Actually, one other thought I had is that you might not be waiting enough time between sending the message that starts the encryption and reading the result. Public key crypto in general is quite expensive, so I’d say try giving it like 30 seconds for the point mul to finish.
If it is crashing, it’s hard to say in general why that might be. Embedded devices have far less memory, so you might be overrunning the stack, or, if you’re using any dynamic memory allocation, running out of RAM.