54102_Shared_Memory

Questions about the BASICtools and MakeItC
Post Reply
olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

54102_Shared_Memory

Post 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
Attachments
M0_shared_mem01.jpg
M0_shared_mem01.jpg (229.15 KiB) Viewed 10978 times



olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: 54102_Shared_Memory

Post 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

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: 54102_Shared_Memory

Post 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

olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: 54102_Shared_Memory

Post 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!!]

Post Reply