-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding mss-can examples reference 1.8.105
- Loading branch information
Showing
343 changed files
with
178,946 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@Library('automated-testing-library') _ | ||
pipelineBareMetalDriverExamples() |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/Debug*/ | ||
/Release*/ | ||
/core | ||
/LIM-Debug/ | ||
/LIM-Release/ | ||
/eNVM-Scratchpad-Release/ | ||
/DDR-Release/ | ||
/.settings/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>mpfs-can-basic</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> | ||
<triggers>clean,full,incremental,</triggers> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> | ||
<triggers>full,incremental,</triggers> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.cdt.core.cnature</nature> | ||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> | ||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# PolarFire SoC MSS Basic CAN example | ||
|
||
This example project demonstrates using the MSS CAN peripheral to perform CAN | ||
message transmission and reception. The MSS CAN driver has APIs for BasicCAN and | ||
FullCAN Configurations. This project is configured for BasicCAN communication. | ||
|
||
The operation of the MSS CAN is controlled via a serial console. | ||
|
||
## How to use this example | ||
|
||
On connecting Icicle kit J11 to the host PC, you should see 4 COM port interfaces. | ||
To use this project, configure the COM port **interface1** as below: | ||
- 115200 baud | ||
- 8 data bits | ||
- 1 stop bit | ||
- no parity | ||
- no flow control | ||
|
||
This is a self contained example project. A greeting message is displayed | ||
over the UART terminal. On startup, the example project requests the user to | ||
enter the data to be send via the CAN Bus. You can enter up to 32 pairs of hex | ||
digits (no separating spaces) and the data will be sent out in chunks of 8 | ||
bytes at a time in up to 4 CAN packets. You can send less than 32 bytes of | ||
data by pressing return to terminate the data early. | ||
|
||
The test program then enters a loop looking for user input to select the next | ||
action to perform. Whilst in this loop, the data portion of any CAN Bus packets | ||
received into the rx buffers is displayed on the console. The following menu | ||
options are available: | ||
|
||
0 - Perform a hardware reset of the MSS CAN peripheral via SYSREG. This | ||
shuts down all CAN communications. | ||
5 - Reinitailze the MSS CAN peripheral then get data from user and send via | ||
CAN Bus. | ||
7 - Get data from user and send via CAN Bus. | ||
|
||
The following macros modify the behaviour of the program: | ||
|
||
CAN_TX_EXTENDED_ID - Defining this macro causes CAN messages with | ||
with extended 29 bit IDs to be sent instead of | ||
the standard 11 bit IDs. | ||
CAN_TARGET_COCO_PC_ACTIVE - Defining this macro adjusts the baud rate to | ||
enable reliable operation with the Kromschroder | ||
CoCo PC Active CAN Bus interface. | ||
Note: Because the BasicCAN example program provides an ISR for the CAN_IRQ, the | ||
following macros need to be defined in the project settings to ensure | ||
interrupts are fully enabled and the default ISR in mss_can.c is disabled: | ||
|
||
MSS_CAN_ENABLE_INTERRUPTS | ||
MSS_CAN_USER_ISR | ||
|
||
Jumper settings: | ||
Connect CAN-0 and PCAN as mentioned below: | ||
|
||
| CAN-0 J27 | PCAN | Description | | ||
|---------------|--------- |--------------| | ||
| 1 | 7 | CAN_H | | ||
| 2 | 2 | CAN_L | | ||
| 3 | 6 | GND | | ||
|
||
## Test CAN Message Transmission | ||
1. Enter the data on UART terminal, which will be received through MSSUART1. | ||
2. Based on received data bytes, segregate as CAN messages of maximum 8 | ||
bytes length. | ||
3. Send the received data in terms of CAN messages. | ||
4. Observe the CAN messages on CAN Analyzer with message identifier as 0x78. | ||
5. Compare the data received on CAN Analyzer with the data sent from the | ||
UART terminal data should be same. | ||
|
||
## Test CAN Message Reception | ||
1. Send the 8 bytes of CAN message from CAN Analyzer with message identifier | ||
as 0x200. | ||
2. Read the data using CAN APIs and store it in to RAM buffer. | ||
3. Transmit the data using MSSUART1 on to UART terminal. | ||
4. Observe the data received on UART terminal. | ||
5. Compare the data sent from CAN Analyzer with the data received on | ||
UART terminal data should be same. | ||
|
||
This project provides build configurations and debug launchers as exaplained | ||
[here](https://github.com/polarfire-soc/polarfire-soc-bare-metal-examples/blob/main/README.md) | ||
|
||
The design description file with this clock setting is available at ./src/boards/icicle-kit-es/fpga_design/design_description/ICICLE_MSS_CAN_8MHz.xml | ||
This project can be tested with standard Libero reference design. However, please make sure that the input clock to MSS CAN block is set to 8MHz in xml. |
61 changes: 61 additions & 0 deletions
61
driver-examples/mss-can/mpfs-can-basic/mpfs-can-basic hw all-harts attach.launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<launchConfiguration type="ilg.gnumcueclipse.debug.gdbjtag.openocd.launchConfigurationType"> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doContinue" value="false"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doDebugInRam" value="false"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doFirstReset" value="false"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateConsole" value="true"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateTelnetConsole" value="false"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doSecondReset" value="false"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbCLient" value="true"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbServer" value="true"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.enableSemihosting" value="false"/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.firstResetType" value="init"/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbClientOtherCommands" value="set $target_riscv = 1 set mem inaccessible-by-default off file ${config_name:mpfs-can-basic}/mpfs-can-basic.elf"/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbClientOtherOptions" value=""/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerConnectionAddress" value=""/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerExecutable" value="${openocd_path}/${openocd_executable}"/> | ||
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerGdbPortNumber" value="3333"/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerLog" value=""/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerOther" value="-c "set DEVICE MPFS" -f board/microsemi-riscv.cfg"/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTclPortNumber" value="6666"/> | ||
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTelnetPortNumber" value="4444"/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.otherInitCommands" value=""/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.otherRunCommands" value=""/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.secondResetType" value=""/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.svdPath" value=""/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU MCU OpenOCD"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="false"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/> | ||
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="false"/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value=""/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/> | ||
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${cross_prefix}gdb${cross_suffix}"/> | ||
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/> | ||
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/> | ||
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/> | ||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="${config_name:mpfs-can-basic}/mpfs-can-basic.elf"/> | ||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="mpfs-can-basic"/> | ||
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/> | ||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/> | ||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> | ||
<listEntry value="/mpfs-can-basic"/> | ||
</listAttribute> | ||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> | ||
<listEntry value="4"/> | ||
</listAttribute> | ||
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="Context string"/> "/> | ||
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/> | ||
</launchConfiguration> |
61 changes: 61 additions & 0 deletions
61
driver-examples/mss-can/mpfs-can-basic/mpfs-can-basic hw all-harts debug.launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<launchConfiguration type="ilg.gnumcueclipse.debug.gdbjtag.openocd.launchConfigurationType"> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doContinue" value="true"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doDebugInRam" value="false"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doFirstReset" value="true"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateConsole" value="true"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doGdbServerAllocateTelnetConsole" value="false"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doSecondReset" value="false"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbCLient" value="true"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.doStartGdbServer" value="true"/> | ||
<booleanAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.enableSemihosting" value="false"/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.firstResetType" value="init"/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbClientOtherCommands" value="set $target_riscv = 1 set mem inaccessible-by-default off file ${config_name:mpfs-can-basic}/mpfs-can-basic.elf"/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbClientOtherOptions" value=""/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerConnectionAddress" value=""/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerExecutable" value="${openocd_path}/${openocd_executable}"/> | ||
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerGdbPortNumber" value="3333"/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerLog" value=""/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerOther" value="-c "set DEVICE MPFS" -f board/microsemi-riscv.cfg"/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTclPortNumber" value="6666"/> | ||
<intAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.gdbServerTelnetPortNumber" value="4444"/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.otherInitCommands" value=""/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.otherRunCommands" value="thread apply all set $pc=_start"/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.openocd.secondResetType" value=""/> | ||
<stringAttribute key="ilg.gnumcueclipse.debug.gdbjtag.svdPath" value=""/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU MCU OpenOCD"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/> | ||
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="false"/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="u54_1"/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/> | ||
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/> | ||
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/> | ||
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${cross_prefix}gdb${cross_suffix}"/> | ||
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/> | ||
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/> | ||
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/> | ||
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="${config_name:mpfs-can-basic}/mpfs-can-basic.elf"/> | ||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="mpfs-can-basic"/> | ||
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/> | ||
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/> | ||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> | ||
<listEntry value="/mpfs-can-basic"/> | ||
</listAttribute> | ||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> | ||
<listEntry value="4"/> | ||
</listAttribute> | ||
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="Context string"/> "/> | ||
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/> | ||
</launchConfiguration> |
65 changes: 65 additions & 0 deletions
65
driver-examples/mss-can/mpfs-can-basic/src/application/hart0/e51.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/******************************************************************************* | ||
* Copyright 2019-2021 Microchip FPGA Embedded Systems Solution. | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* Application code running on E51. | ||
* | ||
* Please refer to README.md file for more details | ||
*/ | ||
|
||
#include "mpfs_hal/mss_hal.h" | ||
#include "inc/common.h" | ||
|
||
volatile uint32_t count_sw_ints_h0 = 0U; | ||
|
||
/* Main function for the hart0(E51 processor). | ||
* Application code running on hart1 is placed here | ||
* | ||
* The hart1 is in WFI while booting, hart0 brings it out of WFI when it raises | ||
* the first Software interrupt. | ||
*/ | ||
void e51(void) | ||
{ | ||
uint8_t flag = 0u; | ||
volatile uint32_t icount = 0U; | ||
uint64_t hartid = read_csr(mhartid); | ||
uint32_t pattern_offset = 12U; | ||
HLS_DATA* hls = (HLS_DATA*)(uintptr_t)get_tp_reg(); | ||
HART_SHARED_DATA * hart_share = (HART_SHARED_DATA *)hls->shared_mem; | ||
|
||
/* Clear pending software interrupt in case there was any. */ | ||
clear_soft_interrupt(); | ||
set_csr(mie, MIP_MSIP); | ||
|
||
(void)mss_config_clk_rst(MSS_PERIPH_MMUART0, (uint8_t) MPFS_HAL_FIRST_HART, PERIPHERAL_ON); | ||
|
||
MSS_UART_init( &g_mss_uart0_lo, | ||
MSS_UART_115200_BAUD, | ||
MSS_UART_DATA_8_BITS | MSS_UART_NO_PARITY | MSS_UART_ONE_STOP_BIT); | ||
|
||
MSS_UART_polled_tx_string(&g_mss_uart0_lo , | ||
(const uint8_t*)"\r\nPlease observe UART-1 for application messages\r\n"); | ||
|
||
/* Raise software interrupt to wake hart 1 */ | ||
raise_soft_interrupt(1U); | ||
|
||
__enable_irq(); | ||
|
||
while (1U) | ||
{ | ||
icount++; | ||
if (0x100000U == icount) | ||
{ | ||
icount = 0U; | ||
} | ||
} | ||
/* never return */ | ||
} | ||
|
||
/* hart0 Software interrupt handler */ | ||
void Software_h0_IRQHandler(void) | ||
{ | ||
uint64_t hart_id = read_csr(mhartid); | ||
count_sw_ints_h0++; | ||
} |
Oops, something went wrong.