예전에 stellarisware(ti/cortex-m3) 쓸 때 이런 컨셉이 있었던 것 같은데, 플래시 용량 줄이는 것 외에는 큰 메리트가 있는지
몰랐는데 아키텍쳐의 차이인진 모르겠지만 벤치마크를 보니 꽤나 혹한다.
2.7.2. Floating-point Support The SDK provides a highly optimized single and double precision floating point implementation. In addition to being fast, many of the functions are actually implemented using support provided in the RP2040 bootrom. This means the interface from your code to the ROM floating point library has very minimal impact on your program size, certainly using dramatically less flash storage than including the standard floating point routines shipped with your compiler. The physical ROM storage on RP2040 has single-cycle access (with a dedicated arbiter on the RP2040 busfabric), and accessing code stored here does not put pressure on the flash cache or take up space in memory, so not only are the routines fast, the rest of your code will run faster due them being resident in ROM. This implementation is used by default as it is the best choice in the majority of cases, however it is also possible to switch to using the regular compiler soft floating point support.
bootrom에 있는 함수들을 이용하면 더욱 빠르게 부동소수점 연산이 가능하다는데
나누기 연산의 경우 GCC 라이브러리에 비해서 586% 감소한다고
아래 두개는 먼가 미친듯한 성능 차이가 있어서 끌어 와봄.
Function ROM/SDK (μs) GCC 9 (μs) Performance Ratio __aeabi_fdiv 74.7 437.5 586% __aeabi_f2lz 63.1 1240.5 1966% __aeabi_f2ulz 46.1 1157 2510%
27페이지에 나오는 내용인데(2021.07.07 기준)
GCC 라이브러리를 사용하여 계산하는 것과
SDK 라이브러리(RP2040 hardware divider)를 이용하는 것의 속도 차이가 어마어마하다고 한다.
1.1 GDB server start-up options --ext-memory-loaders Provides the list of the available external memory loaders.
-el <file_path>, --extload <file_path> Selects a custom external memory-loader.
--external-init Runs Init() from external memory loader after reset to make external memory accessible without need for application software to set up the access to memory-mapped external memory. [This option requires that option -el <file_path>, --extload <file_path> is used also.]
2.3.1 Loading program to external memory When a program must be loaded to an external memory, the option --extload <file_path> must be used. External memory loader files are delivered for most available STM32 Evaluation and Discovery boards containing external memory. To list the available loader files, use the --ext-memory-loaders option. The STM32CubeProgrammer software description user manual (UM2237) contains detailed information on how to use external Flash loader programs and develop customized loaders for external memory. The user manual is available from the STM32CubeProg webpage on www.st.com.
2.3.2 Memory read/write to external memory To make external memory accessible for read and write by the debugger, use the --external-init option together with external memory loader --extload <file_path> option. When --external-init is used the Init() function in the external memory loader is run by the ST-LINK GDB server after reset. This makes external memory accessible without any need for application software to set up the device for external memory access. The external memory must be memory mapped and directly accessed because normal memory read/ write is used by gdb. Note: When using the --external-init option with the ST-LINK GDB server, the stack required by the Init() function is limited to 1024 bytes of stack instead of 400 bytes in ST-LINK GDB server v5.4.0.