View previous topic :: View next topic |
Author |
Message |
kmp84
Joined: 02 Feb 2010 Posts: 345
|
|
Posted: Sun Dec 06, 2020 4:19 pm |
|
|
Now I found correct config.word number. and saw that it changes it's value in output hex file, but bootloader doesn't start with these fuses.
Code: |
#include <33EP512MU810.h>
#fuses NOWDT
#fuses RESET_AUX
#fuses NOIOL1WAY
#fuses CKSFSM //Clock Switching is enabled, fail Safe clock monitor is enabled
#fuses NOBROWNOUT //No brownout reset
#fuses NOJTAG //JTAG disabled
#fuses 3=0x0022
#build (AUX_MEMORY) //Build code for Auxiliary Memory
#use delay(clock=32MHz, crystal=8MHz)
......
|
Configuration Words
F80004: 00FF0022 00FF0080 00FF0001 00FF007F
F8000C: 00FF0037 00FF00D3 00FF0003 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19244
|
|
Posted: Mon Dec 07, 2020 3:04 am |
|
|
OK.
Try with this:
Code: |
#fuses 3=0x0031
#fuses 9=0x0033
|
The compiler behaviour is 'interesting'. It looks as if it misidentifies the
GSS & GWRP bits.
This might not work, since it prevents table read access in the auxiliary
segment.
The code you show does not do any accesses to the program memory
except for reading. Does your 'real' code do anything more?. If it attempts
to erase a row of the program memory, this will not work. |
|
|
kmp84
Joined: 02 Feb 2010 Posts: 345
|
|
Posted: Mon Dec 07, 2020 3:46 am |
|
|
Hi,
Code: |
#fuses 3=0x0031
#fuses 9=0x0033 |
with above fuses aux_bootloader not start!
To recall my purpose: I want to set all fuses in bootloader program + lock program memory from reading. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19244
|
|
Posted: Mon Dec 07, 2020 4:08 am |
|
|
OK. That makes sense. Got the bits the wrong way round.
Code: |
#fuses 3=0x0031
#fuses 9=0x0030
|
Prevents read and write access to the auxiliary segment. If you don't do this
means somebody could overwrite the bootloader with code that can then
access all the memory..... |
|
|
kmp84
Joined: 02 Feb 2010 Posts: 345
|
|
Posted: Mon Dec 07, 2020 4:32 am |
|
|
Quote: |
#fuses 3=0x0031
#fuses 9=0x0030
|
still not starting bootloader. I think this is errata sheet problem? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19244
|
|
Posted: Mon Dec 07, 2020 6:39 am |
|
|
It could be.
I actually think though that the problem is interrupt handling.
The security system has the behaviour that if protection is enabled, and
an interrupt occurs from code in the auxiliary segment, instead of using
the IVT, it'll load a special interrupt vector from 0x7FFFEA. The code here
then has to determine if the interrupt is allowed. |
|
|
kmp84
Joined: 02 Feb 2010 Posts: 345
|
|
Posted: Mon Dec 07, 2020 6:56 am |
|
|
I didn't see any #int_xxx using in CCS pcd_aux_bootloader example. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19244
|
|
Posted: Mon Dec 07, 2020 9:24 am |
|
|
It does, but it is using the INT_AUX vector, which should be correct. |
|
|
|