Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The µC/TFTPs module has to be configured according to your specific needs. A template Template configuration file files (tftp-s_cfg.c/h) is are included in the module package (see section Directories and Files), and this those configuration files should be copied into your application directory and included to your project. Here is the list of the values and description of each of the configuration variable. However, keep in mind that future releases of this module might include more configuration options.

 

...

path. 

Micriµm provides sample configuration code free of charge; however, most sample code will likely require modifications depending on specific feature requirements and memory limitation.

There are two groups of configuration parameters: the compile-time and the run-time configuration.

Compile-Time Configuration

Argument Checking Configuration 

All API functions in μC/TFTPs include code to validate arguments that are passed to it. Specifically, μC/TFTPs checks to see if passed pointers are NULL, if arguments are within valid ranges, etc. The following constant configures additional argument checking.

Constant
Description
Possible Values
TFTPs_CFG_ARG_CHK_EXT_ENIncludes generated code to check arguments for functions that can be called by the user as well as internal functions which receive arguments from an API that the user can call.DEF_ENABLED or DEF_DISABLED

Trace Configuration 

Constant
Description
Possible Values
TFTPs_TRACE_HIST_SIZEConfigures the Trace history size.Minimum value is 16.

Runtime-Time Configuration

µC/TFTPs requires a run-time configuration that must be passed during the initialization. TFTPs run-time configuration template file is provided (see Directories and Files). The run-time configuration template file  (tftp-s_cfg.c ) should be copied into the application folder and modified as per individual project requirements.

Code Block
languagecpp
titleListing - µC/TFTPs Configuration Structure
linenumberstrue
const  TFTPs_CFG  TFTPs_Cfg = {
/*
*--------------------------------------------------------------------------------------------------------
*                                    TFTP SERVER CONFIGURATION
*--------------------------------------------------------------------------------------------------------
*/
                                                        /* Configure socket type  :                

...

Defines the UDP port µC/TFTPs will receive requests on. The default value (69) is the one specified in RFC #1350.
 

...

*/
        TFTPs_SOCK_SEL_IPv4,
														/* TFTPs_SOCK_SEL_IPv4       Accept Only IPv4.          */
                                                      

...

 

...

 /* TFTPs_

...

SOCK_

...

Define the maximum receive and transmit timeouts in milliseconds.
 

...

SEL_IPv6       Accept Only IPv6.          */

 														/* TFTP Server port number.                                     */
         69,
                                                      
/*
*--------------------------------------------------------------------------------------------------------
*                                     TIMEOUT CONFIGURATION
*--------------------------------------------------------------------------------------------------------
*/
         5000,                                          /* Maximum inactivity time (ms) on RX.                          */
         5000                                           /* Maximum inactivity time (ms) on TX.                          */
};

...

Define the maximum number of trace items to keep in memory.

OS Task Configuration

...

Task Configuration

µC/TFTPs also requires a task configuration that must be passed during the initialization.


Code Block
languagecpp
titleListing - µC/TFTPs Task Configuration Structure
linenumberstrue
const  TFTPs_

...

TASK_CFG

...

  TFTPs_TaskCfg = {
        15u,                                                    

...

Value of the priority for the µC/TFTPs task. The value assigned depends upon the software architecture of your system, and on the importance of this module’s response time relative to other tasks.

 

#define  TFTPs_OS_CFG_TASK_STK_SIZE       512

...

/* .Prio         (TFTPs task priority)                  */
        2048,                                                   /* .StkSizeBytes (TFTPs task stack size in bytes)       */
        DEF_NULL,                                               /* .StkPtr       (TFTPs task stack pointer)             */
};