- STM32F429i Discover Board
- Emblocks IDE 2.30
- ARM GCC Compiler 4.7 (Emblocks - bare-metal)
- Compiler options with harf-FPU (-mfloat-abi=hard)
- CMSIS library "libarm_cortexM4lf_math.a"
Unfortunately, the original example did not terminated successfully, and falled into hard fault. After some investigation, I figured out the problem is related with bit reversing flag. When the example without bit reversing terminates successfuly, ofcource it is not useful.
The reason of this problem is the pre-built GCC library has not the function "arm_bitreversal_32", because a reason regarding the source written in assembly language. So in my situation following workaround succeeded.
;/**
; ******************************************************************************
; * @file sg_bitreversal_32.S
; * @author ierturk @ StarGate
; * @version V1.0.0
; * @date 24-May-2014
; * @brief Re implement bit reversal
; ******************************************************************************
; * @attention
; *
; * <h2><center>© COPYRIGHT 2014 SarGate Inc</center></h2>
; *
; * Unless required by applicable law or agreed to in writing, software
; * distributed under the License is distributed on an "AS IS" BASIS,
; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; * See the License for the specific language governing permissions and
; * limitations under the License.
; *
; ******************************************************************************
;*/
.syntax unified
.thumb
.global sg_bitreversal_32
sg_bitreversal_32:
ADDS r3,r1,#1
CMP r3,#1
IT LS
BXLS lr
PUSH {r4-r9}
ADDS r1,r2,#2
LSRS r3,r3,#2
sg_bitreversal_32_0:
LDRH r8,[r1,#4]
LDRH r9,[r1,#2]
LDRH r2,[r1,#0]
LDRH r12,[r1,#-2]
ADD r8,r0,r8
ADD r9,r0,r9
ADD r2,r0,r2
ADD r12,r0,r12
LDR r7,[r9,#0]
LDR r6,[r8,#0]
LDR r5,[r2,#0]
LDR r4,[r12,#0]
STR r6,[r9,#0]
STR r7,[r8,#0]
STR r5,[r12,#0]
STR r4,[r2,#0]
LDR r7,[r9,#4]
LDR r6,[r8,#4]
LDR r5,[r2,#4]
LDR r4,[r12,#4]
STR r6,[r9,#4]
STR r7,[r8,#4]
STR r5,[r12,#4]
STR r4,[r2,#4]
ADDS r1,r1,#8
SUBS r3,r3,#1
BNE sg_bitreversal_32_0
POP {r4-r9}
BX lr
;/************************ (C) COPYRIGHT StarGate Inc *****END OF FILE****/