Skip to content

Commit

Permalink
V1.1
Browse files Browse the repository at this point in the history
- Renamed lib-spiflashinstall to lib-flashcodeinstall
- Renamed lib-spiflashstore to lib-configstore
- Removed lib-spiflash
- Added lib-flashcode
  • Loading branch information
vanvught committed Dec 17, 2022
1 parent 1561063 commit 79f7f8e
Show file tree
Hide file tree
Showing 154 changed files with 17,064 additions and 14,711 deletions.
4 changes: 2 additions & 2 deletions bootloader-tftp/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-network/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-remoteconfig/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-spiflashstore/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-spiflashinstall/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-configstore/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-flashcodeinstall/include}&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.762735176" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
Expand Down
2 changes: 1 addition & 1 deletion bootloader-tftp/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="([^/\\\\]*)((g?cc)|([gc]\+\+)|(clang))" prefer-non-shared="true"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="757981198595729255" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="758215147008721255" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
7 changes: 5 additions & 2 deletions bootloader-tftp/Makefile.GD32
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ DEFINES =DISABLE_JSON
DEFINES+=DISABLE_BIN
DEFINES+=DISABLE_RTC
DEFINES+=DISABLE_FS
DEFINES+=DISABLE_PRINTF_FLOAT

DEFINES+=UDP_MAX_PORTS_ALLOWED=2

DEFINES+=CONFIG_FLASHROM_USE_I2C
#DEFINES+=ENET_LINK_CHECK_REG_POLL

DEFINES+=CONFIG_STORE_USE_I2C

DEFINES+=NDEBUG

SRCDIR=firmware lib

LIBS=display spiflashstore remoteconfig spiflashinstall spiflash
LIBS=remoteconfig flashcodeinstall configstore display flash flashcode

include ../firmware-template-gd32/Rules.mk

Expand Down
8 changes: 4 additions & 4 deletions bootloader-tftp/firmware/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
#include "firmwareversion.h"
#include "software_version.h"

#include "spiflashinstall.h"
#include "spiflashstore.h"
#include "flashcodeinstall.h"
#include "configstore.h"

#include "gd32.h"

Expand Down Expand Up @@ -101,8 +101,8 @@ int main(void) {

fw.Print("Bootloader TFTP Server");

SpiFlashInstall flashInstall;
SpiFlashStore flashStore;
FlashCodeInstall flashCodeInstall;
ConfigStore configStore;

StoreNetwork storeNetwork;
nw.SetNetworkStore(&storeNetwork);
Expand Down
20,913 changes: 10,459 additions & 10,454 deletions bootloader-tftp/gd32f4xx.list

Large diffs are not rendered by default.

3,763 changes: 1,891 additions & 1,872 deletions bootloader-tftp/gd32f4xx.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bootloader-tftp/include/software_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
#ifndef SOFTWARE_VERSION_H_
#define SOFTWARE_VERSION_H_

constexpr char SOFTWARE_VERSION[] = "1.0";
constexpr char SOFTWARE_VERSION[] = "1.1";

#endif /* SOFTWARE_VERSION_H_ */
30 changes: 15 additions & 15 deletions bootloader-tftp/lib/networkdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,36 @@
#include "display.h"
#include "display7segment.h"

namespace networkdisplay {
namespace network {
static constexpr auto LINE_IP = 2U;
} // namespace networkdisplay

void NetworkDisplay::ShowEmacStart() {
Display::Get()->ClearLine(networkdisplay::LINE_IP);
void display_emac_start() {
Display::Get()->ClearLine(LINE_IP);
Display::Get()->PutString("Ethernet start");
}

void NetworkDisplay::ShowIp() {
Display::Get()->ClearLine(networkdisplay::LINE_IP);
Display::Get()->Printf(networkdisplay::LINE_IP, "" IPSTR "/%d %c", IP2STR(Network::Get()->GetIp()), Network::Get()->GetNetmaskCIDR(), Network::Get()->GetAddressingMode());
void display_ip() {
Display::Get()->ClearLine(LINE_IP);
Display::Get()->Printf(LINE_IP, "" IPSTR "/%d %c", IP2STR(Network::Get()->GetIp()), Network::Get()->GetNetmaskCIDR(), Network::Get()->GetAddressingMode());
}

void NetworkDisplay::ShowNetMask() {
ShowIp();
void display_netmask() {
display_ip();
}

void NetworkDisplay::ShowGatewayIp() {
void display_gateway() {
}

void NetworkDisplay::ShowHostName() {
void display_hostname() {
}

void NetworkDisplay::ShowShutdown() {
Display::Get()->ClearLine(networkdisplay::LINE_IP);
void display_emac_shutdown() {
Display::Get()->ClearLine(LINE_IP);
Display::Get()->PutString("Ethernet shutdown");
}

void NetworkDisplay::ShowDhcpStatus(network::dhcp::ClientStatus nStatus) {
Display::Get()->ClearLine(networkdisplay::LINE_IP);
void display_dhcp_status(network::dhcp::ClientStatus nStatus) {
Display::Get()->ClearLine(LINE_IP);

switch (nStatus) {
case network::dhcp::ClientStatus::IDLE:
Expand All @@ -85,3 +84,4 @@ void NetworkDisplay::ShowDhcpStatus(network::dhcp::ClientStatus nStatus) {
break;
}
}
} // namespace network
1 change: 1 addition & 0 deletions firmware-template-gd32/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ LIBS+=c++ c gd32
$(info [${LIBS}])

DEFINES:=$(addprefix -D,$(DEFINES))
DEFINES+=-DCONFIG_STORE_USE_I2C

ifeq ($(findstring BOARD_BW_OPIDMX4,$(BOARD)), BOARD_BW_OPIDMX4)
DEFINES+=-DCONSOLE_I2C
Expand Down
1 change: 1 addition & 0 deletions firmware-template-gd32/gd32f450vi_flash.ld
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ SECTIONS
. = ALIGN(4);
*(.bkpsram)
*(.bkpsram*)
*(.configstore*)
} >BKPSRAM AT>BKPSRAM

/DISCARD/ :
Expand Down
1 change: 1 addition & 0 deletions firmware-template-gd32/lib/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ include ../firmware-template-gd32/Includes.mk

DEFINES:=$(addprefix -D,$(DEFINES))
DEFINES+=-D_TIME_STAMP_YEAR_=$(shell date +"%Y") -D_TIME_STAMP_MONTH_=$(shell date +"%-m") -D_TIME_STAMP_DAY_=$(shell date +"%-d")
DEFINES+=-DCONFIG_STORE_USE_I2C

COPS=-DBARE_METAL -DGD32 -DGD32F450 -D$(BOARD)
COPS+=$(DEFINES) $(MAKE_FLAGS) $(INCLUDES)
Expand Down
2 changes: 1 addition & 1 deletion lib-c++/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="757981198595729255" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="758215147008721255" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
2 changes: 1 addition & 1 deletion lib-c/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<builder arguments="-f Makefile.GD32" id="cdt.managedbuild.builder.gnu.cross.883324977" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.22051247" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.321243516" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-spiflashinstall/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/lib-flashcodeinstall/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/include}&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.634822811" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
Expand Down
2 changes: 1 addition & 1 deletion lib-c/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="757981198595729255" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="758215147008721255" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
2 changes: 1 addition & 1 deletion lib-c/src/malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct block_bucket {
struct block_header *free_list;
};

#include "../lib-spiflashinstall/include/spiflashinstall.h"
#include "../lib-flashcodeinstall/include/flashcodeinstall.h"

static struct block_bucket s_block_bucket[] __attribute__((aligned(4))) = {{0x20, 0}, {0x40, 0}, {0x60, 0}, {0x80,0}, {0x100,0}, {0x140,0}, {0x180,0}, {0x200,0}, {0x300,0}, {0x400,0}, {FIRMWARE_MAX_SIZE,0}, {0,0}};

Expand Down
Loading

0 comments on commit 79f7f8e

Please sign in to comment.