 |
|
 |
MESC TOOL NEWS:
MESCT-MR32R-010316D
Please take note of the following problem in using real-time OS MR32R for the M32R family of microcomputers.
- Versions Concerned
- MR32R V.1.00 Release 1 -- MR32R V.3.30 Release 1
- Descriptions
- 2.1 Problem on Memory Mapping
- In MR32R, several limitations are imposed on mapping sections into areas beyond 16 Mbytes from the beginning address (beyond address 1000000H). The descriptions below are a supplement to Section 5.7 "Memory Mapping" in Users Manual of MR32R V.3.30 Release 1.
- Limitations on memory mapping
- (1) The following sections can be mapped into areas beyond address 1000000H if dynamic creation functions are not used:
- INT_USR_STACK, EXT_USR_STACK sections
These are mapped unless dynamic creation functions cre_tsk, del_tsk, exd_tsk, and def_exc are used.
- EXT_MR_RAM, MR_HEAP, EXT_MR_HEAP sections
These are mapped unless dynamic creation functions cre_mbx, del_mbx, cre_mbf, del_mbf, cre_mpf, del_mpf, cre_mpl, and del_mpl are used.
- (2) The following sections cannot be mapped into areas beyond address 1000000H:
- MR_RAM, MR_ROM, INTERRUPT_VECTOR, MR_Dbg_RAM sections
- SYS_STACK sections
- MR_KERNEL, MR_KERNEL2, OS_DEBUG sections
- (3) Limitation on the START_UP section
- Because each OS kernel is invoked from the startup routine (described in crt0mr.ms or crt0mr.s) with instruction bra or bl, the START_UP section cannot be mapped into areas beyond the allowable jump addresses with instruction bra or bl.
- * Whether the code sections (such as P and .text) and data sections (such as B, D, and C, or bss, .data, and .rodata) that applications use are mapped or not is compiler-dependent. Furthermore, it might be necessary for the mapping to change compiler options and linking standard libraries as well as reconfigure standard libraries.
For details, refer to your compiler's manual.
- 2.2 Workarounds
- (1) The method of mapping each section described in 2.1 (1) by using dynamic creation functions or mapping the SYS_STACK section into an area beyond address 1000000H:
- Make a modification in startup file crt0mr.ms and ten modifications in initialization macro file mr32r.inc as shown below.
If D-CC/M32R used, modify crt0mr.s so that it can read the symbols described in the crt0mr.ms's modification as shown below, in 32 bits.
- Modifications to be made in startup file crt0mr.ms
[Modified]
__START:
seth R1,#high(__Sys_Sp)
or3 R1,R1,#low(__Sys_Sp)
[Original] Line No. 55 in crt0mr.ms
__START:
ld24 R1,#__Sys_Sp
- Modifications to be made in initialization macro file mr32r.inc
(1)[Modified]
seth R5,#high(__MR_INT_SP_TOP) ; memadd
or3 R5,R5,#low(__MR_INT_SP_TOP) ; memadd
[Original] Line No. 1477
ld24 R5,#__MR_INT_SP_TOP ; memadd
(2) [Modified]
seth R5,#high(__MR_EXT_SP_TOP) ; memadd
or3 R5,R5,#low(__MR_EXT_SP_TOP) ; memadd
[Original] Line No. 1495
ld24 R5,#__MR_EXT_SP_TOP ; memadd
(3) [Modified]
seth R5,#high(__MR_INT_MBX_TOP)
or3 R5,R5,#low(__MR_INT_MBX_TOP)
[Original] Line No. 1561
ld24 R5,#__MR_INT_MBX_TOP
(4) [Modified]
seth R5,#high(__MR_EXT_MBX_TOP)
or3 R5,R5,#low(__MR_EXT_MBX_TOP)
[Original] Line No. 1587
ld24 R5,#__MR_EXT_MBX_TOP
(5) [Modified]
seth R5,#high(__MR_INT_MBF_TOP)
or3 R5,R5,#low(__MR_INT_MBF_TOP)
[Original] Line No. 1658
ld24 R5,#__MR_INT_MBF_TOP
(6) [Modified]
seth R5,#high(__MR_EXT_MBF_TOP)
or3 R5,R5,#low(__MR_EXT_MBF_TOP)
[Original] Line No. 1685
ld24 R5,#__MR_EXT_MBF_TOP
(7) [Modified]
seth R5,#high(__MR_INT_MPL_TOP)
or3 R5,R5,#low(__MR_INT_MPL_TOP)
[Original] Line No. 1765
ld24 R5,#__MR_INT_MPL_TOP
(8) [Modified]
seth R5,#high(__MR_EXT_MPL_TOP)
or3 R5,R5,#low(__MR_EXT_MPL_TOP)
[Original] Line No. 1791
ld24 R5,#__MR_EXT_MPL_TOP
(9) [Modified]
seth R5,#high(__MR_INT_MPF_TOP)
or3 R5,R5,#low(__MR_INT_MPF_TOP)
[Original] Line No. 1886
ld24 R5,#__MR_INT_MPF_TOP
(10) [Modified]
seth R5,#high(__MR_EXT_MPF_TOP)
or3 R5,R5,#low(__MR_EXT_MPF_TOP)
[Original] Line No. 1912
ld24 R5,#__MR_EXT_MPF_TOP
- (2) The method of mapping sections MR_KERNEL, MR_KERNEL2, and OS_DEBUG into areas beyond address 1000000H:
- Change the definitions of the EIT vector entry made in the startup file as follows:
- In order to map these sections into areas beyond address 1000000H,
first describe instructions that make jumps up to address 1000000H, and just after this description, describe jump instructions whose destinations are SYSCALL0 and SYSCALL1 for calling OS kernels in 32 bits.
- Call int_entry in 32 bits.
- (3) The method of mapping the START_UP section anywhere:
- Use instruction jmp or jl instead of bra or bl in the startup routine (described in crt0mr.ms or crt0mr.s) and initialization macro file mr32r.inc, and the START_UP section can be mapped anywhere.
- Schedule of Fixing Problem
We plan to fix the problem described in 2.1 (1) above in our next release.
|
 |