Skip to content

Commit e0ec1b4

Browse files
committed
Fix RAM address and add ITCM and DTCM sections
Previously DTCM region was simply added to RAM region, this can cause problems with DMA as DMA does not have access to DTCM region. See page 71 and 76 in data sheet RM0410 Rev 4. #123 Signed-off-by: Moritz Scheuren <moritz.scheuren@systec-electronic.com>
1 parent 708ac86 commit e0ec1b4

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

memory_2048_368.x

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,32 @@ MEMORY
33
{
44
/* NOTE K = KiBi = 1024 bytes */
55
FLASH : ORIGIN = 0x08000000, LENGTH = 2M
6-
RAM : ORIGIN = 0x20000000, LENGTH = 368K + 16K
6+
RAM : ORIGIN = 0x20020000, LENGTH = 368K + 16K
7+
ITCM : ORIGIN = 0x00000000, LENGTH = 16K /* Instruction Tighly Coupled Memory */
8+
DTCM : ORIGIN = 0x20000000, LENGTH = 128K /* Data Tighly Coupled Memory */
79
}
810

11+
SECTIONS
12+
{
13+
.itcm : ALIGN(4)
14+
{
15+
*(.itcm .itcm.*);
16+
. = ALIGN(4);
17+
} > ITCM
18+
19+
.dtcm : ALIGN(4)
20+
{
21+
*(.dtcm .dtcm.*);
22+
. = ALIGN(4);
23+
} > DTCM
24+
}
25+
26+
/* You can then use something like this to place a variable into a specific section of memory:
27+
* #[link_section = ".dtcm.BUFFER"]
28+
* static mut BUF: [u8; 1024] = [3u8; 1024];
29+
* Verifiable with: cargo size --release --example hello_world -- -A
30+
*/
31+
932
/* This is where the call stack will be allocated. */
1033
/* The stack is of the full descending type. */
1134
/* NOTE Do NOT modify `_stack_start` unless you know what you are doing */

0 commit comments

Comments
 (0)