Page 1 of 1

54102_Shared_Memory

Posted: Sat Jan 26, 2019 2:07 am
by olzeke51
I was attempting to use the M0-M4 communication memory region to pass a variable.
1) It wouldn't compile unless I used parenthesis around the CONST - [this isn't indicated in the online 'Help file' for * Pointers
2) hard faulting in the M0 - see the 'code' address [and I also ' commented it out - with good results]

M4 code

Code: Select all

'm4 simple
print "M4 ";timer
wait(33000)
end

Re: 54102_Shared_Memory

Posted: Sat Jan 26, 2019 3:15 am
by olzeke51
I was able to read / write the M0 memory area &H03400600- okay
'
in the &H2017c0x
Tried to JUST read the M0/M4 communication memory area - got hardfault in the M0 program
'
the M4 had no problem writing/reading that same area
HTH

Re: 54102_Shared_Memory

Posted: Sat Jan 26, 2019 4:43 am
by basicchip
2 issues--

yes the current compiler does not recognize *const_val where const_val is defined as a BASIC const

-- been fixed here, but not released yet, we tend to use #defines for these types of constants, just the way we do it

-------

as for the memory issue, I am not seeing that

M4 program

print "M4 here"

M0 program

wait(100)
print *&H2017c00

works fine

Re: 54102_Shared_Memory

Posted: Sat Jan 26, 2019 4:48 pm
by olzeke51
MY BAD - I was writing/reading a non-aligned memory address.--causing the hard fault. :oops:
Bruce caught that in an offline discussion.
[too much 8bit world in my mind/experience!!]