Skip to content

Commit

Permalink
Sync with local development
Browse files Browse the repository at this point in the history
  • Loading branch information
vanvught committed Feb 22, 2024
1 parent 1c6f037 commit b1d6eab
Show file tree
Hide file tree
Showing 26 changed files with 3,286 additions and 1,067 deletions.
411 changes: 411 additions & 0 deletions CMSIS/Core/Include/cachel1_armv7.h

Large diffs are not rendered by default.

2,366 changes: 2,366 additions & 0 deletions CMSIS/Core/Include/core_cm7.h

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions CMSIS/Core/Include/tz_context.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/******************************************************************************
* @file tz_context.h
* @brief Context Management for Armv8-M TrustZone
* @version V1.0.1
* @date 10. January 2018
******************************************************************************/
/*
* Copyright (c) 2017-2018 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#if defined ( __ICCARM__ )
#pragma system_include /* treat file as system include file for MISRA check */
#elif defined (__clang__)
#pragma clang system_header /* treat file as system include file */
#endif

#ifndef TZ_CONTEXT_H
#define TZ_CONTEXT_H

#include <stdint.h>

#ifndef TZ_MODULEID_T
#define TZ_MODULEID_T
/// \details Data type that identifies secure software modules called by a process.
typedef uint32_t TZ_ModuleId_t;
#endif

/// \details TZ Memory ID identifies an allocated memory slot.
typedef uint32_t TZ_MemoryId_t;

/// Initialize secure context memory system
/// \return execution status (1: success, 0: error)
uint32_t TZ_InitContextSystem_S (void);

/// Allocate context memory for calling secure software modules in TrustZone
/// \param[in] module identifies software modules called from non-secure mode
/// \return value != 0 id TrustZone memory slot identifier
/// \return value 0 no memory available or internal error
TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module);

/// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S
/// \param[in] id TrustZone memory slot identifier
/// \return execution status (1: success, 0: error)
uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id);

/// Load secure context (called on RTOS thread context switch)
/// \param[in] id TrustZone memory slot identifier
/// \return execution status (1: success, 0: error)
uint32_t TZ_LoadContext_S (TZ_MemoryId_t id);

/// Store secure context (called on RTOS thread context switch)
/// \param[in] id TrustZone memory slot identifier
/// \return execution status (1: success, 0: error)
uint32_t TZ_StoreContext_S (TZ_MemoryId_t id);

#endif // TZ_CONTEXT_H
14 changes: 12 additions & 2 deletions firmware-template-gd32/Includes.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ INCLUDES+=-I../lib-gd32/${FAMILY}/${FAMILY_UC}_standard_peripheral/Include
INCLUDES+=-I../lib-gd32/${FAMILY}/CMSIS/GD/${FAMILY_UC}/Include
INCLUDES+=-I../lib-gd32/include

USB_HOST=
ifeq ($(findstring ENABLE_USB_HOST,$(DEFINES)), ENABLE_USB_HOST)
USB_HOST=1
endif
ifeq ($(findstring ENABLE_USB_HOST,$(MAKE_FLAGS)), ENABLE_USB_HOST)
USB_HOST=1
endif

USB_HOST_MSC=
ifeq ($(findstring ENABLE_USB_HOST,$(DEFINES)), ENABLE_USB_HOST)
USB_HOST_MSC=1
endif
Expand Down Expand Up @@ -55,6 +53,18 @@ ifeq ($(findstring gd32f4xx,$(FAMILY)), gd32f4xx)
endif
endif

ifeq ($(findstring gd32h7xx,$(FAMILY)), gd32h7xx)
ifdef USB_HOST
INCLUDES+=-I../lib-gd32/${FAMILY}/GD32H7xx_usbhs_library/driver/Include
INCLUDES+=-I../lib-gd32/${FAMILY}/GD32H7xx_usbhs_library/host/core/Include
INCLUDES+=-I../lib-gd32/${FAMILY}/GD32H7xx_usbhs_library/ustd/common
ifdef USB_HOST_MSC
INCLUDES+=-I../lib-gd32/${FAMILY}/GD32H7xx_usbhs_library/host/class/msc/Include
INCLUDES+=-I../lib-gd32/${FAMILY}/GD32H7xx_usbhs_library/ustd/class/msc
endif
endif
endif

ifdef USB_HOST_MSC
EXTRA_INCLUDES+=../lib-hal/ff14b/source
endif
13 changes: 13 additions & 0 deletions gd32_emac_artnet_pixel_dmx_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@

#include "mdns.h"

#if defined (ENABLE_NTP_CLIENT)
# include "ntpclient.h"
#endif

#include "displayudf.h"
#include "displayudfparams.h"
#include "displayhandler.h"
Expand Down Expand Up @@ -101,6 +105,12 @@ void main() {
fw.Print("Art-Net 4 Pixel controller {16x 4 Universes} / 2x DMX");
nw.Print();

#if defined (ENABLE_NTP_CLIENT)
NtpClient ntpClient;
ntpClient.Start();
ntpClient.Print();
#endif

display.TextStatus(ArtNetMsgConst::PARAMS, Display7SegmentMessage::INFO_NODE_PARMAMS, CONSOLE_YELLOW);

ArtNetNode node;
Expand Down Expand Up @@ -279,6 +289,9 @@ void main() {
pixelTestPattern.Run();
}
mDns.Run();
#if defined (ENABLE_NTP_CLIENT)
ntpClient.Run();
#endif
#if defined (NODE_RDMNET_LLRP_ONLY)
llrpOnlyDevice.Run();
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1708278917;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1704725179;
3 changes: 3 additions & 0 deletions gd32_emac_artnet_pixel_dmx_multi/lib/showfileusb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ void usb_ready() {

if (ShowFile::Get()->IsAutoStart()) {
ShowFile::Get()->Start();
} else {
ShowFile::Get()->LoadShows();
}

DEBUG_EXIT
Expand All @@ -45,6 +47,7 @@ void usb_disconnected() {
DEBUG_ENTRY

ShowFile::Get()->Stop();
ShowFile::Get()->UnloadShows();

DEBUG_EXIT
}
Expand Down
13 changes: 13 additions & 0 deletions gd32_emac_artnet_pixel_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@

#include "mdns.h"

#if defined (ENABLE_NTP_CLIENT)
# include "ntpclient.h"
#endif

#include "displayudf.h"
#include "displayudfparams.h"
#include "displayhandler.h"
Expand Down Expand Up @@ -94,6 +98,12 @@ void main() {
fw.Print("Art-Net 4 Pixel controller {8x 4 Universes}");
nw.Print();

#if defined (ENABLE_NTP_CLIENT)
NtpClient ntpClient;
ntpClient.Start();
ntpClient.Print();
#endif

display.TextStatus(ArtNetMsgConst::PARAMS, Display7SegmentMessage::INFO_NODE_PARMAMS, CONSOLE_YELLOW);

ArtNetNode node;
Expand Down Expand Up @@ -236,6 +246,9 @@ void main() {
pixelTestPattern.Run();
}
mDns.Run();
#if defined (ENABLE_NTP_CLIENT)
ntpClient.Run();
#endif
#if defined (NODE_RDMNET_LLRP_ONLY)
llrpOnlyDevice.Run();
#endif
Expand Down
2 changes: 1 addition & 1 deletion gd32_emac_artnet_pixel_multi/include/sofware_version_id.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1708278927;
constexpr uint32_t DEVICE_SOFTWARE_VERSION_ID=1706294736;
3 changes: 3 additions & 0 deletions gd32_emac_artnet_pixel_multi/lib/showfileusb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ void usb_ready() {

if (ShowFile::Get()->IsAutoStart()) {
ShowFile::Get()->Start();
} else {
ShowFile::Get()->LoadShows();
}

DEBUG_EXIT
Expand All @@ -45,6 +47,7 @@ void usb_disconnected() {
DEBUG_ENTRY

ShowFile::Get()->Stop();
ShowFile::Get()->UnloadShows();

DEBUG_EXIT
}
Expand Down
13 changes: 13 additions & 0 deletions gd32_emac_ddp_pixel_dmx_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

#include "mdns.h"

#if defined (ENABLE_NTP_CLIENT)
# include "ntpclient.h"
#endif

#include "displayudf.h"
#include "displayudfparams.h"
#include "displayhandler.h"
Expand Down Expand Up @@ -87,6 +91,12 @@ void main() {
fw.Print("DDP Pixel controller {16x 4 Universes} / 2x DMX");
nw.Print();

#if defined (ENABLE_NTP_CLIENT)
NtpClient ntpClient;
ntpClient.Start();
ntpClient.Print();
#endif

display.TextStatus(NetworkConst::MSG_MDNS_CONFIG, Display7SegmentMessage::INFO_MDNS_CONFIG, CONSOLE_YELLOW);

MDNS mDns;
Expand Down Expand Up @@ -208,6 +218,9 @@ void main() {
pixelTestPattern.Run();
}
mDns.Run();
#if defined (ENABLE_NTP_CLIENT)
ntpClient.Run();
#endif
#if defined (NODE_RDMNET_LLRP_ONLY)
llrpOnlyDevice.Run();
#endif
Expand Down
13 changes: 13 additions & 0 deletions gd32_emac_ddp_pixel_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

#include "mdns.h"

#if defined (ENABLE_NTP_CLIENT)
# include "ntpclient.h"
#endif

#include "displayudf.h"
#include "displayudfparams.h"
#include "displayhandler.h"
Expand Down Expand Up @@ -81,6 +85,12 @@ void main() {
fw.Print("DDP Pixel controller {8x 4 Universes}");
nw.Print();

#if defined (ENABLE_NTP_CLIENT)
NtpClient ntpClient;
ntpClient.Start();
ntpClient.Print();
#endif

display.TextStatus(NetworkConst::MSG_MDNS_CONFIG, Display7SegmentMessage::INFO_MDNS_CONFIG, CONSOLE_YELLOW);

MDNS mDns;
Expand Down Expand Up @@ -184,6 +194,9 @@ void main() {
pixelTestPattern.Run();
}
mDns.Run();
#if defined (ENABLE_NTP_CLIENT)
ntpClient.Run();
#endif
#if defined (NODE_RDMNET_LLRP_ONLY)
llrpOnlyDevice.Run();
#endif
Expand Down
13 changes: 13 additions & 0 deletions gd32_emac_e131_pixel_dmx_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

#include "mdns.h"

#if defined (ENABLE_NTP_CLIENT)
# include "ntpclient.h"
#endif

#include "displayudf.h"
#include "displayudfparams.h"
#include "displayhandler.h"
Expand Down Expand Up @@ -100,6 +104,12 @@ void main() {
fw.Print("sACN E1.31 Pixel controller {8x 4 Universes} / 2x DMX");
nw.Print();

#if defined (ENABLE_NTP_CLIENT)
NtpClient ntpClient;
ntpClient.Start();
ntpClient.Print();
#endif

display.TextStatus(E131MsgConst::PARAMS, Display7SegmentMessage::INFO_BRIDGE_PARMAMS, CONSOLE_YELLOW);

E131Bridge bridge;
Expand Down Expand Up @@ -280,6 +290,9 @@ void main() {
pixelTestPattern.Run();
}
mDns.Run();
#if defined (ENABLE_NTP_CLIENT)
ntpClient.Run();
#endif
#if defined (NODE_RDMNET_LLRP_ONLY)
llrpOnlyDevice.Run();
#endif
Expand Down
3 changes: 3 additions & 0 deletions gd32_emac_e131_pixel_dmx_multi/lib/showfileusb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ void usb_ready() {

if (ShowFile::Get()->IsAutoStart()) {
ShowFile::Get()->Start();
} else {
ShowFile::Get()->LoadShows();
}

DEBUG_EXIT
Expand All @@ -45,6 +47,7 @@ void usb_disconnected() {
DEBUG_ENTRY

ShowFile::Get()->Stop();
ShowFile::Get()->UnloadShows();

DEBUG_EXIT
}
Expand Down
13 changes: 13 additions & 0 deletions gd32_emac_e131_pixel_multi/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

#include "mdns.h"

#if defined (ENABLE_NTP_CLIENT)
# include "ntpclient.h"
#endif

#include "displayudf.h"
#include "displayudfparams.h"
#include "displayhandler.h"
Expand Down Expand Up @@ -94,6 +98,12 @@ void main() {
fw.Print("sACN E1.31 Pixel controller {8x 4 Universes}");
nw.Print();

#if defined (ENABLE_NTP_CLIENT)
NtpClient ntpClient;
ntpClient.Start();
ntpClient.Print();
#endif

display.TextStatus(E131MsgConst::PARAMS, Display7SegmentMessage::INFO_BRIDGE_PARMAMS, CONSOLE_YELLOW);

E131Bridge bridge;
Expand Down Expand Up @@ -231,6 +241,9 @@ void main() {
pPixelTestPattern->Run();
}
mDns.Run();
#if defined (ENABLE_NTP_CLIENT)
ntpClient.Run();
#endif
#if defined (NODE_RDMNET_LLRP_ONLY)
llrpOnlyDevice.Run();
#endif
Expand Down
3 changes: 3 additions & 0 deletions gd32_emac_e131_pixel_multi/lib/showfileusb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ void usb_ready() {

if (ShowFile::Get()->IsAutoStart()) {
ShowFile::Get()->Start();
} else {
ShowFile::Get()->LoadShows();
}

DEBUG_EXIT
Expand All @@ -45,6 +47,7 @@ void usb_disconnected() {
DEBUG_ENTRY

ShowFile::Get()->Stop();
ShowFile::Get()->UnloadShows();

DEBUG_EXIT
}
Expand Down
Loading

0 comments on commit b1d6eab

Please sign in to comment.