Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
atsamd51
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
hello-world
atsamd51
Commits
60f2196b
Commit
60f2196b
authored
5 years ago
by
Erik Strand
Browse files
Options
Downloads
Patches
Plain Diff
DICE tests
parent
fd9a459f
Branches
dice
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
baremetal/Makefile
+1
-1
1 addition, 1 deletion
baremetal/Makefile
baremetal/main.c
+35
-9
35 additions, 9 deletions
baremetal/main.c
baremetal/openocd.cfg
+1
-0
1 addition, 0 deletions
baremetal/openocd.cfg
with
37 additions
and
10 deletions
baremetal/Makefile
+
1
−
1
View file @
60f2196b
...
@@ -9,7 +9,7 @@ MCU_DEFINE := __SAMD51J19A__
...
@@ -9,7 +9,7 @@ MCU_DEFINE := __SAMD51J19A__
# Flags
# Flags
LFLAGS
+=
-mthumb
-mabi
=
aapcs-linux
-mlong-calls
-mcpu
=
cortex-m4
-mfloat-abi
=
softfp
-mfpu
=
fpv4-sp-d16
-DSAMD51
LFLAGS
+=
-mthumb
-mabi
=
aapcs-linux
-mlong-calls
-mcpu
=
cortex-m4
-mfloat-abi
=
softfp
-mfpu
=
fpv4-sp-d16
-DSAMD51
CFLAGS
+=
-x
c
-DDEBUG
-Os
-ffunction-sections
-g3
-Wall
-c
-std
=
gnu99
$(
LFLAGS
)
CFLAGS
+=
-x
c
-DDEBUG
-ffunction-sections
-g3
-Wall
-c
-std
=
gnu99
$(
LFLAGS
)
INCLUDES
+=
-I
"samd51"
-I
"samd51/CMSIS/Include"
-I
"samd51/include"
-I
"samd51/startup"
INCLUDES
+=
-I
"samd51"
-I
"samd51/CMSIS/Include"
-I
"samd51/include"
-I
"samd51/startup"
# List the subdirectories for creating object files
# List the subdirectories for creating object files
...
...
This diff is collapsed.
Click to expand it.
baremetal/main.c
+
35
−
9
View file @
60f2196b
...
@@ -3,23 +3,49 @@
...
@@ -3,23 +3,49 @@
int
main
(
void
)
{
int
main
(
void
)
{
int
i
;
int
i
;
// red led is 17, green led is 19
// red led is
A
17, green led is
A
19
(lit when low)
REG_PORT_DIR0
=
(
1u
<<
17
)
|
(
1u
<<
19
);
REG_PORT_DIR0
=
(
1u
<<
17
)
|
(
1u
<<
19
);
//
green led
//
make sure they start off
//
REG_PORT_
DIR0 |=
(1u<<19);
REG_PORT_
OUTSET0
=
(
1u
<<
17
)
|
(
1u
<<
19
);
//REG_PORT_OUTCLR0 = (1u << 19);
// Prepare output signals (A5, A22)
//REG_PORT_OUTSET0 = (1u << 17);
REG_PORT_DIR0
|=
(
1u
<<
5
)
|
(
1u
<<
22
);
// make sure they start low
REG_PORT_OUTSET0
=
(
1u
<<
5
)
|
(
1u
<<
22
);
// Prepare input signals (A8, B13)
/*
PORT->Group[0].PINCFG[8].bit.INEN = 1;
PORT->Group[0].PINCFG[8].bit.PULLEN = 1;
PORT->Group[1].PINCFG[13].bit.INEN = 1;
PORT->Group[1].PINCFG[13].bit.PULLEN = 1;
*/
while
(
1
)
{
while
(
1
)
{
REG_PORT_OUTSET0
=
(
1u
<<
17
);
// Listeners
REG_PORT_OUTCLR0
=
(
1u
<<
19
);
/*
if ((REG_PORT_IN0 & (1u << 8)) || (REG_PORT_IN1 & (1u << 13))) {
// Turn on the LED.
REG_PORT_OUTCLR0 = (1u << 17) | (1u << 19);
// Raise the signal wires.
REG_PORT_OUTSET0 = (1u << 5) | (1u << 22);
} else {
// Turn off the LED.
REG_PORT_OUTSET0 = (1u << 17) | (1u << 19);
// Lower the signal wires.
REG_PORT_OUTCLR0 = (1u << 5) | (1u << 22);
}
*/
// Director
REG_PORT_OUTCLR0
=
(
1u
<<
17
)
|
(
1u
<<
19
);
REG_PORT_OUTSET0
=
(
1u
<<
5
)
|
(
1u
<<
22
);
for
(
i
=
0
;
i
<
1000000
;
i
++
)
{
for
(
i
=
0
;
i
<
1000000
;
i
++
)
{
__asm
(
"nop"
);
__asm
(
"nop"
);
}
}
REG_PORT_OUT
CLR
0
=
(
1u
<<
17
);
REG_PORT_OUT
SET
0
=
(
1u
<<
17
)
|
(
1u
<<
19
)
;
REG_PORT_OUT
SET
0
=
(
1u
<<
19
);
REG_PORT_OUT
CLR
0
=
(
1u
<<
5
)
|
(
1u
<<
22
);
for
(
i
=
0
;
i
<
1000000
;
i
++
)
{
for
(
i
=
0
;
i
<
1000000
;
i
++
)
{
__asm
(
"nop"
);
__asm
(
"nop"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
baremetal/openocd.cfg
+
1
−
0
View file @
60f2196b
...
@@ -5,3 +5,4 @@ transport select swd
...
@@ -5,3 +5,4 @@ transport select swd
# Chip info
# Chip info
set
CHIPNAME
at91samd51j18
set
CHIPNAME
at91samd51j18
source
[find target/atsame5x.cfg]
source
[find target/atsame5x.cfg]
reset
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment