Merge branch 'main' into Modbus_TCP_Obe

This commit is contained in:
Obe Van Lierde
2023-11-13 16:06:47 +01:00
17 changed files with 4447 additions and 3657 deletions

3
.gitignore vendored
View File

@@ -56,5 +56,4 @@ project/.mxproject
project/project.launch project/project.launch
project/Scripts project/Scripts
Scripts/ Scripts/
project/project\ Debug.launch

View File

@@ -7,6 +7,8 @@ The llfs filesystem is a flat filesystem, meaning that it does not support direc
The mkllfs utilit can be used to generate the `llfs_data.c` file. The `llfs_data.c` file from a directory with files. The mkllfs utilit can be used to generate the `llfs_data.c` file. The `llfs_data.c` file from a directory with files.
A pre-compiled version can be download: [mkllfs.exe](https://github.com/Sani7/2023-Webservices_And_Applications/releases/tag/v0.2.0)
## Usage ## Usage
The mkllfs utility can be used as follows: The mkllfs utility can be used as follows:
```bash ```bash
@@ -22,6 +24,10 @@ Available options:
-v, --version print the version of mkllfs and the llfs library that it generates for -v, --version print the version of mkllfs and the llfs library that it generates for
``` ```
### Using the batch file
The `mkllfs.bat` file can be used to generate the `llfs_data.c` file from the data in the `llfs-data` directory.
Before using this script, place mkllfs.exe in the same directory as the batch file.
## Building ## Building
The mkllfs utility can be built using the following command: The mkllfs utility can be built using the following command:
```bash ```bash
@@ -30,4 +36,4 @@ gcc -o mkllfs mkllfs.c
For windows, you can use the following command: For windows, you can use the following command:
```bash ```bash
gcc -o mkllfs.exe mkllfs.c gcc -o mkllfs.exe mkllfs.c
``` ```

BIN
llfs-data/color_bar.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
llfs-data/st.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

1
llfs-data/test.txt Normal file
View File

@@ -0,0 +1 @@
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer penatibus lorem nunc semper venenatis vestibulum urna. Hac elit inceptos mattis integer sollicitudin pellentesque parturient. Est fermentum laoreet class egestas odio tellus condimentum.

1
llfs-data/test2.txt Normal file
View File

@@ -0,0 +1 @@
Aliquet pellentesque morbi fermentum dolor fermentum auctor lacinia. Montes euismod habitasse fringilla praesent sodales metus interdum. Lacinia vel duis cum auctor class commodo adipiscing. Elementum condimentum taciti iaculis metus ornare duis curae. Risus consectetur urna convallis metus fusce arcu class. Nisl himenaeos vel praesent laoreet taciti himenaeos lacus. Duis pharetra aptent phasellus sodales imperdiet aptent elit.

2
mkllfs.cmd Normal file
View File

@@ -0,0 +1,2 @@
mkllfs.exe llfs-data project/Core/Src/llfs_data.c
pause

View File

@@ -1,7 +1,7 @@
/** /**
* @file main.c * @file main.c
* @brief Converts files to a C file that can be used by llfs (linked list file system). * @brief Converts files to a C file that can be used by llfs (linked list file system).
* @version 0.1.0 * @version 0.2.0
* @author Lorenz C. * @author Lorenz C.
*/ */
@@ -10,8 +10,8 @@
#include <string.h> #include <string.h>
#include "tinydir.h" #include "tinydir.h"
#define VERSION "0.1.0" #define VERSION "0.2.0"
#define LLFS_VERSION "0.1.0" #define LLFS_VERSION "0.1.1"
#define MAX_PATH_LEN 256 #define MAX_PATH_LEN 256
static void file_name_to_llfs_name(char* llfs_name, const char* file_name); static void file_name_to_llfs_name(char* llfs_name, const char* file_name);
@@ -99,6 +99,7 @@ int main(int argc, char** argv) {
// Write the file data to the output file // Write the file data to the output file
fprintf(out_file, "// File: %s\n", file.name); fprintf(out_file, "// File: %s\n", file.name);
fprintf(out_file, "__attribute__((section(\".ext_qspi_flash\")))\n");
fprintf(out_file, "const uint8_t %s_data[] = {\n", llfs_name); fprintf(out_file, "const uint8_t %s_data[] = {\n", llfs_name);
for (int i = 0, c; (c = fgetc(src_file)) != EOF; i++) { for (int i = 0, c; (c = fgetc(src_file)) != EOF; i++) {
file_size++; file_size++;

View File

@@ -94,9 +94,9 @@
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1923792012.2015795402" name="test_data.h" rcbsApplicability="disable" resourcePath="Core/Inc/test_data.h" toolsToInvoke=""/> <fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1923792012.2015795402" name="test_data.h" rcbsApplicability="disable" resourcePath="Core/Inc/test_data.h" toolsToInvoke=""/>
<sourceEntries> <sourceEntries>
<entry excluding="Inc/fsdata_custom.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/> <entry excluding="Inc/fsdata_custom.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="LWIP"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="LWIP"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
</sourceEntries> </sourceEntries>
</configuration> </configuration>
</storageModule> </storageModule>

View File

@@ -95,4 +95,13 @@ void lcd_display_text(uint8_t* text, uint16_t x_pos, uint16_t y_pos, uint32_t co
*/ */
void lcd_draw_bmp(const void* p_src, uint32_t x_pos, uint32_t y_pos, uint32_t x_size, uint32_t y_size, uint32_t color_mode); void lcd_draw_bmp(const void* p_src, uint32_t x_pos, uint32_t y_pos, uint32_t x_size, uint32_t y_size, uint32_t color_mode);
/**
* @brief Clear LCD screen
* Clears the whole LCD screen to the desired color
*
*@param[in] color Color to which the LCD should be cleared
*/
void lcd_clear(uint32_t color);
#endif /* INC_LCD_API_H_ */ #endif /* INC_LCD_API_H_ */

View File

@@ -95,3 +95,7 @@ void lcd_draw_bmp(const void* p_src, uint32_t x_pos, uint32_t y_pos, uint32_t x_
LOG_INFO(TAG, "DMA2D poll"); LOG_INFO(TAG, "DMA2D poll");
HAL_DMA2D_PollForTransfer(&hDma2dHandler2, 10); HAL_DMA2D_PollForTransfer(&hDma2dHandler2, 10);
} }
void lcd_clear(uint32_t color){
BSP_LCD_Clear(color);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -93,8 +93,6 @@
#define LWIP_HTTPD_SSI 1 #define LWIP_HTTPD_SSI 1
/*----- Default Value for LWIP_HTTPD_SSI_RAW: 0 ---*/ /*----- Default Value for LWIP_HTTPD_SSI_RAW: 0 ---*/
#define LWIP_HTTPD_SSI_RAW 1 #define LWIP_HTTPD_SSI_RAW 1
/*----- Default Value for LWIP_HTTPD_SUPPORT_POST: 0 ---*/
#define LWIP_HTTPD_SUPPORT_POST 1
/*----- Default Value for LWIP_HTTPD_CUSTOM_FILES: 0 ---*/ /*----- Default Value for LWIP_HTTPD_CUSTOM_FILES: 0 ---*/
#define LWIP_HTTPD_CUSTOM_FILES 1 #define LWIP_HTTPD_CUSTOM_FILES 1
/*----- Value in opt.h for HTTPD_USE_CUSTOM_FSDATA: 0 -----*/ /*----- Value in opt.h for HTTPD_USE_CUSTOM_FSDATA: 0 -----*/

View File

@@ -46,6 +46,7 @@ MEMORY
{ {
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
QSPI (xrw) : ORIGIN = 0x90000000, LENGTH = 16M
} }
/* Sections */ /* Sections */
@@ -182,4 +183,9 @@ SECTIONS
} }
.ARM.attributes 0 : { *(.ARM.attributes) } .ARM.attributes 0 : { *(.ARM.attributes) }
.ext_qspi_flash :
{
*(.ext_qspi_flash)
} >QSPI
} }

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.st.stm32cube.ide.mcu.debug.launch.launchConfigurationType">
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.access_port_id" value="0"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_live_expr" value="true"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.enable_swv" value="false"/>
<intAttribute key="com.st.stm32cube.ide.mcu.debug.launch.formatVersion" value="2"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.ip_address_local" value="localhost"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.enabled" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.limit_swo_clock.value" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.loadList" value="{&quot;fItems&quot;:[{&quot;fIsFromMainTab&quot;:true,&quot;fPath&quot;:&quot;Debug/project.elf&quot;,&quot;fProjectName&quot;:&quot;project&quot;,&quot;fPerformBuild&quot;:true,&quot;fDownload&quot;:true,&quot;fLoadSymbols&quot;:true}]}"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.override_start_address_mode" value="default"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.remoteCommand" value="target remote"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startServer" value="true"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.divby0" value="true"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.exception.unaligned" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.startuptab.haltonexception" value="true"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swd_mode" value="true"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_port" value="61235"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.swv_trace_hclk" value="16000000"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.useRemoteTarget" value="true"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.launch.vector_table" value=""/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.launch.verify_flash_download" value="true"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.cti_allow_halt" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.cti_signal_halt" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_external_loader" value="true"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_logging" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_max_halt_delay" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_shared_stlink" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.external_loader" value="N25Q128A_STM32F746G-DISCO, 0x90000000, NOR_FLASH, N25Q128A_STM32F746G-DISCO.stldr"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.external_loader_init" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.frequency" value="0"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.halt_all_on_reset" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.log_file" value="D:\school\2023-2024\Webservices and Applications YT6258\Labo\Synthese-opdracht\2023-Webservices_And_Applications\project\Debug\st-link_gdbserver_log.txt"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.low_power_debug" value="disable"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.max_halt_delay" value="2"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.reset_strategy" value="connect_under_reset"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_check_serial_number" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{&quot;fVersion&quot;:1,&quot;fItems&quot;:[{&quot;fDisplayName&quot;:&quot;Reset&quot;,&quot;fIsSuppressible&quot;:false,&quot;fResetAttribute&quot;:&quot;Software system reset&quot;,&quot;fResetStrategies&quot;:[{&quot;fDisplayName&quot;:&quot;Software system reset&quot;,&quot;fLaunchAttribute&quot;:&quot;system_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset\r\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Hardware reset&quot;,&quot;fLaunchAttribute&quot;:&quot;hardware_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset hardware\r\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Core reset&quot;,&quot;fLaunchAttribute&quot;:&quot;core_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset core\r\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;None&quot;,&quot;fLaunchAttribute&quot;:&quot;no_reset&quot;,&quot;fGdbCommands&quot;:[],&quot;fCmdOptions&quot;:[&quot;-g&quot;]}],&quot;fGdbCommandGroup&quot;:{&quot;name&quot;:&quot;Additional commands&quot;,&quot;commands&quot;:[]},&quot;fStartApplication&quot;:true}]}"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="threadx"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverAuto" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriverPort" value="cortex_m0"/>
<intAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyPort" value="60000"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="com.st.stm32cube.ide.mcu.debug.stlink"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="61234"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
<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.DEBUGGER_START_MODE" value="remote"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/project.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="project"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1923792012"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/project"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;"/>
<stringAttribute key="process_factory_id" value="com.st.stm32cube.ide.mcu.debug.launch.HardwareDebugProcessFactory"/>
</launchConfiguration>

View File

@@ -43,7 +43,7 @@ LWIP.LWIP_HTTPD_CGI_SSI=1
LWIP.LWIP_HTTPD_CUSTOM_FILES=1 LWIP.LWIP_HTTPD_CUSTOM_FILES=1
LWIP.LWIP_HTTPD_SSI=1 LWIP.LWIP_HTTPD_SSI=1
LWIP.LWIP_HTTPD_SSI_RAW=1 LWIP.LWIP_HTTPD_SSI_RAW=1
LWIP.LWIP_HTTPD_SUPPORT_POST=1 LWIP.LWIP_HTTPD_SUPPORT_POST=0
LWIP.LWIP_IGMP=1 LWIP.LWIP_IGMP=1
LWIP.LWIP_TFTP=1 LWIP.LWIP_TFTP=1
LWIP.MEMP_MEM_MALLOC=1 LWIP.MEMP_MEM_MALLOC=1