TITLE
-----
ALGRF (ALGorithm instantiation for Reference Frameworks) module
USAGE
-----
RF3, RF5
DESCRIPTION
-----------
ALGRF is a module used for creation, deletion, activation, and deactivation
of XDAIS algorithms. It has the similar purpose as the ALG module included in
the standard XDAIS installation, except that the module is optimized for
DSP/BIOS usage.
FILES
-----
Each ALGRF function is placed in a separate file to avoid dead code, unless
two or more functions are always dependent; in that case, they are placed
together in a single source file.
- algrf*.pjt: project files for building a library for the appropriate
architecture
- algrf_activate.c: ALGRF_activate() function
- algrf_control.c: ALGRF_control() function
- algrf_cre.c: ALGRF_create(), ALGRF_free() functions
- algrf_creScratchSupport.c: ALGRF_createScratchSupport() function,
ALGRF_memFreeScratchSupport() function
- algrf_deactivate.c: ALGRF_deactivate() function
- algrf_delete.c: ALGRF_delete() function
- algrf_delScratchSupport.c ALGRF_deleteScratchSupport() function
- algrf_exit.c: ALGRF_exit() function
- algrf_init.c: ALGRF_init() function
- algrf_setup.c: ALGRF_setup() function
- ../include/algrf.h: public header file for the ALGRF module
- readme.txt: this file
NOTE
----
Files in the library are compiled with no optimization switches turned on,
and the same is true for the project files. If you plan to use this module
in a product release, it is advised that you rebuild the library with
optimization turned on.
Q&A
---
Q1: How is ALGRF different from ALG?
Q2: How do I set up ALGRF?
Q3: How do I instantiate an XDAIS algorithm using ALGRF?
Q4: What other ALGRF functions are available?
Q5: Where can I find more information?
---
Q1: How is ALGRF different from ALG?
A1: The ALGRF library module is a set of XDAIS algorithm instantiation
procedures for Reference Frameworks. It is functionally similar to the ALG
module included in the XDAIS installation directory; the module has been
named "ALGRF" instead of "ALG" to avoid name conflicts, and the
corresponding ALG_ function name prefixes have been changed to ALGRF_.
The ALGRF module differs from the ALG module in its implementation of
memory management, in that it uses the MEM module from DSP/BIOS instead of
the standard malloc(), as the former provides greater control and
flexibility in managing memory heaps. Functions from the MEM module
(MEM_alloc(), MEM_free() et al.) always operate over a specific DSP/BIOS
heap segment, as defined in the configuration tool, so the "heap segment
identifier" information has to be communicated to the ALGRF module in its
initialization phase. This information is used by the ALGRF module to
determine exactly which DSP/BIOS MEM heap should be used for a specific
algorithm's memory needs.
Using the ALGRF module consists of a setup call (once in the application
lifetime), algorithm instantiation calls (once per algorithm instance),
and optionally deleting/moving/controlling algorithms etc. Setup must
be performed before any other ALGRF function is called.
---
Q2: How do I set up ALGRF?
A2: Heap segment identifier in DSP/BIOS is an integer variable, defined
in files automatically generated from the configuration database,
and it uniquely identifies the heap segment within a memory section.
For instance, if the segment IDATA has an unnamed heap of a certain size,
then this heap can be referred to by IDATA, where IDATA must be declared
by the user as
extern Int IDATA;
If the memory segment's heap has a name assigned by the user, an integer
variable with that name identifies the heap. If the heap is named, that
name should be used instead.
Heap segment identifiers are passed to the ALGRF module via
the ALGRF_setup() procedure call:
Void ALGRF_setup( Int internalHeap, Int externalHeap );
Parameters internalHeap, externalHeap are heap segment
identifiers for internal heap, external heap.
Internal and/or external heaps are used by XDAIS algorithms, as indicated
in their specification.
A typical ALGRF setup, in a system that has a heap named INTERNALHEAP in
internal memory, and a heap named EXTERNALHEAP in external memory, would be
extern Int INTERNALHEAP;
extern Int EXTERNALHEAP;
...
ALGRF_setup( INTERNALHEAP, EXTERNALHEAP );
In the example, dynamic heap INTERNALHEAP is used for internal memory for
the algorithms, and EXTERNALHEAP is used for external memory for the
algorithms.
An example of an ALGRF setup in a system where only internal memory exists,
but where the application uses XDAIS algorithms that may ask for external
memory, would be
extern Int INTERNALHEAP;
...
ALGRF_setup( INTERNALHEAP, INTERNALHEAP );
The above setting will result in the algorithm instance always having
its memory blocks allocated in internal memory, regardless of whether
it asks for external memory or not.
---
Q3: How do I instantiate an XDAIS algorithm using ALGRF?
A3: Function ALGRF_create() is used for creating a new instance of an XDAIS
algorithm where scratch memory, if any, is *not* reused among algorithms:
ALGRF_Handle ALGRF_create( IALG_Fxns *fxns, IALG_Handle parent,
IALG_Params *params );
Parameters fxns, parent (usually NULL), and params are the standard
instance creation parameters as used in the ALG_create function, the
difference being that ALGRF_create() returns ALGRF_Handle as the type
of the handle of the created instance; the value is the handle of the
instance or NULL if the creation failed.
Type ALGRF_Handle is a generic XDAIS algorithm handle type, equivalent
to the ALG_Handle type in the standard ALG module.
Typically one might use wrappers for creating instances, as in
static inline FIR_Handle FIR_create( IFIR_Fxns *fxns, FIR_Params *prms )
{
return ( (FIR_Handle)
ALGRF_create((IALG_Fxns *)fxns, NULL, (IALG_Params *)prms) );
}
where the generic handle is cast to the algorithm specific handle.
For applications in which two or more algorithms can reuse the same
scratch buffer, the user must calculate the max combined scratch size
needed by the 'worst-case' algorithm, allocate the buffer
of that size, and provide the buffer address and size as parameters to
ALGRF_createScratchSupport() function.
(combined scratch size refers to a situation in which an algorithm instance
needs more than one scratch buffer, so if an algorithm instance needs one
scratch buffer of size s1 and one of size s2, the combined scratch size
needs for that instance is s1 + s2; Alignment is also a factor in that
equation and is covered below. "largest" refers to the maximum of all
scratch size needs across all the algorithms sharing the buffer). The
scratch buffer is allocated by the user and passed as the argument to
ALGRF_createScratchSupport().
The user must ensure that standard conditions for reusing scratch buffers
are met (non-preemption among the algorithm instances using the same
scratch buffer etc.)
Alignment must also be catered for with internal, scratch requests. e.g.
memTab[3].size = 50;
memTab[3].alignment = 2;
memTab[5].size = 100;
memTab[5].alignment = 32;
scratchBuf scratchSize to be passed to ALGRF_createScratchSupport() ==
50 + 2 + 100 + 32 = 184.
This keeps it simple.
Signature is :-
ALGRF_Handle ALGRF_createScratchSupport( IALG_Fxns *fxns,
IALG_Handle parent, IALG_Params *params, Void *scratchBuf,
Int scratchSize );
Example usage :-
Flash二级引导程序
需积分: 0 173 浏览量
更新于2024-03-05
收藏 1.66MB ZIP 举报
在IT行业中,引导程序是计算机启动过程中的关键组件,它负责加载操作系统并为系统的后续运行做好准备。在嵌入式系统或微控制器(如MCU)中,引导程序通常分为多级,其中“Flash二级引导程序”是一个重要的概念。本文将深入探讨这个主题,以及与“Download”标签相关的下载过程。
Flash二级引导程序,顾名思义,是在Flash存储器中运行的第二阶段引导加载程序。在许多嵌入式系统中,引导过程通常分为两个阶段:一级引导程序和二级引导程序。一级引导程序通常位于ROM或OTP(一次性编程)内存中,因为这些区域不易被修改,能确保系统的初始安全性。它负责进行基本的硬件初始化,如设置CPU时钟、初始化RAM和验证二级引导程序的完整性。
一旦一级引导程序完成其任务,它会将控制权交给位于Flash存储器中的二级引导程序。Flash存储器因其容量大、成本低和可编程性而广泛用于存储操作系统映像和其他代码。二级引导程序的职责更为复杂,可能包括:
1. 验证和加载操作系统内核到内存。
2. 更新系统固件或应用程序,这与“Download”标签相关。
3. 提供用户交互界面,如Bootloader菜单,允许用户选择要启动的操作系统版本或执行其他操作。
4. 处理错误恢复,例如在系统崩溃后恢复到已知良好状态。
在“Download”这个标签下,我们通常指的是通过某种方式将新的固件或软件下载到设备上。在嵌入式系统中,这通常通过串口、USB、以太网或无线连接进行。下载过程中可能涉及以下步骤:
1. **连接**:设备与主机(如PC)建立通信连接。
2. **传输协议**:使用特定的协议(如UART、USB CDC、TFTP、FTP或HTTP)进行数据传输。
3. **验证**:接收端校验下载的数据,确保无误。
4. **存储**:将接收到的数据写入目标存储器,如Flash。
5. **执行/更新**:如果需要,二级引导程序会加载新下载的固件或更新现有程序。
文件列表中的`rf3_dsk6713_boot`和`rf3_dsk6713_boot_with_table`可能是针对特定开发板(如RF3 DSK6713)的一级或二级引导程序的不同版本。`BlinkDSK6713`可能是一个示例程序或固件,用于演示设备功能,如LED闪烁。
“Flash二级引导程序”和“Download”标签涉及到嵌入式系统的启动流程和固件更新机制,这是理解并维护这类设备的关键知识。熟悉这些概念和技术对于开发、调试和维护嵌入式系统至关重要。
XSChan
- 粉丝: 2
- 资源: 1
最新资源
- 基于STM32的智能家居系统全部资料+详细文档+优秀项目.zip
- 基于阿里云的智能家居控制APP全部资料+详细文档+优秀项目.zip
- 基于stm32智能家居项目全部资料+详细文档+优秀项目.zip
- 基于安卓与STM32通信硬件开发项目,实现安卓端控制家庭灯,窗帘,门,有毒有害其他报警等,全部资料+详细文档+优秀项目.zip
- 基于安卓的智能家居项目源码,通过Zigbee网络控制采集家居设备实现管理功能、全部资料+详细文档+优秀项目.zip
- 基于从零开始打造一个智能家居系统全部资料+详细文档+优秀项目.zip
- 基于单片机课程实践——智能家居系统(安卓端)全部资料+详细文档+优秀项目.zip
- 基于机智云平台打造的物联网智能家居一体化智能App、全部资料+详细文档+优秀项目.zip
- 基于电力线载波智能家居控制系统全部资料+详细文档+优秀项目.zip
- 基于使用Qt制作的智能家居上位机全部资料+详细文档+优秀项目.zip
- 基于使用“树莓派+Django+bootstrap”搭建的智能家居监控系统全部资料+详细文档+优秀项目.zip
- 基于米家智能门锁接入开源智能家居系统全部资料+详细文档+优秀项目.zip
- 基于使用STM32、ESP8266、微信小程序搭建的MQTT智能家居全部资料+详细文档+优秀项目.zip
- 基于树莓派Linux智能家居自定义语音助手, 全部资料+详细文档+优秀项目.zip
- 基于天猫精灵智能家居技能对接homeassistant全部资料+详细文档+优秀项目.zip
- 基于一组Python脚本程序,用来控制小米智能家居设备全部资料+详细文档+优秀项目.zip