Skip to content

Commit e936a11

Browse files
authored
Merge pull request #21 from CarletonURocketry/board-reset
Board reset
2 parents 1d1b8b0 + e6b59cb commit e936a11

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

configs/mocksensors/defconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,15 @@ CONFIG_ARMV7M_DCACHE=y
2727
CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y
2828
CONFIG_ARMV7M_DTCM=y
2929
CONFIG_ARMV7M_ICACHE=y
30+
CONFIG_BOARDCTL_RESET=y
31+
CONFIG_BOARDCTL_USBDEVCTRL=y
3032
CONFIG_BOARD_COREDUMP_SYSLOG=y
3133
CONFIG_BOARD_CUSTOM_LEDS=y
3234
CONFIG_BOARD_INITTHREAD_STACKSIZE=2048
3335
CONFIG_BOARD_LATE_INITIALIZE=y
3436
CONFIG_BOARD_LOOPSPERMSEC=79943
3537
CONFIG_BUILTIN=y
38+
CONFIG_CDCACM=y
3639
CONFIG_COREDUMP=y
3740
CONFIG_DEBUG_ASSERTIONS=y
3841
CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y
@@ -119,9 +122,11 @@ CONFIG_START_YEAR=2024
119122
CONFIG_STM32H7_ADC2=y
120123
CONFIG_STM32H7_ADC2_SAMPLE_FREQUENCY=10
121124
CONFIG_STM32H7_ADC2_TIMTRIG=1
125+
CONFIG_STM32H7_HSI48=y
122126
CONFIG_STM32H7_I2C1=y
123127
CONFIG_STM32H7_I2C2=y
124128
CONFIG_STM32H7_I2C4=y
129+
CONFIG_STM32H7_OTGFS=y
125130
CONFIG_STM32H7_SDMMC1=y
126131
CONFIG_STM32H7_TIM1=y
127132
CONFIG_STM32H7_TIM1_CH3OUT=y
@@ -149,6 +154,7 @@ CONFIG_UORB_LISTENER=y
149154
CONFIG_UORB_WARN=y
150155
CONFIG_USART1_SERIAL_CONSOLE=y
151156
CONFIG_USART2_BAUD=57600
157+
CONFIG_USBDEV=y
152158
CONFIG_USENSOR=y
153159
CONFIG_WIRELESS=y
154160
CONFIG_WIRELESS_PKTRADIO=y

src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ if(CONFIG_USBDEV)
4848
list(APPEND SRCS stm32_usb.c)
4949
endif()
5050

51+
if(CONFIG_BOARCTL_RESET)
52+
list(APPEND SRCS josh_reset.c)
53+
endif()
54+
5155

5256
target_sources(board PRIVATE ${SRCS})
5357

src/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,8 @@ ifeq ($(CONFIG_USBDEV),y)
5050
CSRCS += stm32_usb.c
5151
endif
5252

53+
ifeq ($(CONFIG_BOARDCTL_RESET),y)
54+
CSRCS += josh_reset.c
55+
endif
56+
5357
include $(TOPDIR)/boards/Board.mk

src/josh_reset.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/****************************************************************************
2+
* boards/arm/stm32h7/josh/src/stm32_reset.c
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed to the Apache Software Foundation (ASF) under one or more
7+
* contributor license agreements. See the NOTICE file distributed with
8+
* this work for additional information regarding copyright ownership. The
9+
* ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
* "License"); you may not use this file except in compliance with the
11+
* License. You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
* License for the specific language governing permissions and limitations
19+
* under the License.
20+
*
21+
****************************************************************************/
22+
23+
/****************************************************************************
24+
* Included Files
25+
****************************************************************************/
26+
27+
#include <nuttx/config.h>
28+
29+
#include <nuttx/arch.h>
30+
#include <nuttx/board.h>
31+
32+
#ifdef CONFIG_BOARDCTL_RESET
33+
34+
/****************************************************************************
35+
* Public Functions
36+
****************************************************************************/
37+
38+
int board_reset(int mode)
39+
{
40+
/* Normal reset */
41+
42+
up_systemreset();
43+
}
44+
45+
#endif /* CONFIG_BOARDCTL_RESET */

0 commit comments

Comments
 (0)