Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:28 03 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PICOMITE: Can you read them?

     Page 2 of 2    
Author Message
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 08:48am 07 Feb 2023
Copy link to clipboard 
Print this post

  Grogster said  Lets be honest and have a wee comparison here - even the PIC32 chips can be read like that, to create a HEX file that contains MMBASIC and the program code, provided the chip has not been copy protected.  I've never done that(copy protected them) with the MM2 series of chips

But the point is to use the PIC32's protection feature.

It's really tough to beat.

John
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7939
Posted: 08:53am 07 Feb 2023
Copy link to clipboard 
Print this post

Just to make it less obvious in your code it might be an idea to do a convoluted comparison like:
If MM.INFO(ID) AND NOT(&H6A) THEN ...

It would be less obvious to the casual observer than something like:
IF MM.INFO(ID) = 3124 then

I'm not saying that either of these would work, it's just an idea.

You could even have a VAR SAVE value or two that you do a logical operation on with the ID to get something important.

I think that if you want something like the PIC32's protection then you'll have to use a PIC32, not a RP2040 with a non-protected flash chip. The latter simply isn't designed for secure data, the PIC32 is (it's intended for embedded processing).
Edited 2023-02-07 18:57 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10316
Posted: 09:00am 07 Feb 2023
Copy link to clipboard 
Print this post

This security issue is the same for all XIP (execute in place) processor chips with no in-built flash memory - same for the ESP chips. It is just a limitation that users have to accept or not.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 01:42am 08 Feb 2023
Copy link to clipboard 
Print this post

Understood.

This thread has come up with some very clever ideas though, so thanks for all the posts.
Smoke makes things work. When the smoke gets out, it stops!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 01:03pm 08 Feb 2023
Copy link to clipboard 
Print this post

  JohnS said  [...] use the PIC32's protection feature.

It's really tough to beat


with the MX170 version of MMbasic, i take it this is not 'turned on' by default. is it possible to enable the protection after the MMbasic firmware has been loaded onto your MX170, and once enabled is it still possible to edit basic programs, save variables, change options, etc?


cheers,
rob   :-)
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 02:11pm 08 Feb 2023
Copy link to clipboard 
Print this post

  robert.rozee said  
  JohnS said  [...] use the PIC32's protection feature.

It's really tough to beat


with the MX170 version of MMbasic, i take it this is not 'turned on' by default. is it possible to enable the protection after the MMbasic firmware has been loaded onto your MX170, and once enabled is it still possible to edit basic programs, save variables, change options, etc?


cheers,
rob   :-)


Have a look at the PIC32 device config words - Section 32 of the PIC32 docs - DEVCFG0, DEVCFG1, DEVCFG2, DEVCFG3, especially bits CP, BWP & PWP.

I think by default all PIC32 MMBasics leave protection off.

I'm doubtful they can be turned on at runtime but they need to go from 1 to 0 so maybe?

Quite easy to set the right values before programming the chip, though (worst case, edit the HEX file).

I don't know whether you'd be able to make the changes you asked - try it :) - but probably OK as it's the running code that is doing stuff whereas these settings are to prevent outside stuff doing much other than a chip erase/reprogram.

John
Edited 2023-02-09 00:14 by JohnS
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025