Block size error

5 posts / 0 new
Last post
sgarcia_1564
Offline
Last seen: 1 day 20 hours ago
Joined: 10/23/2017 - 6:43pm
Block size error

Hello,

I have adapted the BSP you guys provided for the F407 to my board which has the F411. I can connect to AWE Designer over HID, but once I load the layout I run into HARD FAULTs on my MCU.  I can tell it is a memory leak of some kind, as I can see that inside of awe_fwGetClassType there is a jump to an invalid location thus resulting in a hard fault right when the layout is loaded. As I am trying to trace where they I coming from (it is hard since it occurs inside of the CFFramework library somewhere), I noticed the layout does not reflect the Block Size I have chosen (48 for my system) as it still says the default of 32 in the Audio Weaver Server TargetInformation box.

Furthermore, if I draw up a simple layout,  and try to change the SYS_in and SYS_out to 48 block size, I get this Audio Weaver Error:

I am trying to find where in the code this "Basic Block size" is advertised to AWE, but I can only find this initializer that does not have block size in it:

    awe_fwInitTargetInfo(&g_AWEInstance, 
                         CORE_ID, 
                         CORE_SPEED, 
                         SAMPLE_SPEED,
                         "ST32F411", 
                         PROCESSOR_TYPE_CORTEXM4,
                         HAS_FLOAT_SUPPORT,
                         HAS_FLASH_FILESYSTEM,
                         NO_HW_INPUT_PINS,
                         NO_HW_OUTPUT_PINS,
                         IS_SMP,
                         NO_THREADS_SUPPORTED,
                         FIXED_SAMPLE_RATE,
                         INPUT_CHANNEL_COUNT,
                         OUTPUT_CHANNEL_COUNT,
                         VER_DAY, VER_MONTH, VER_YEAR
                         );

Any of these parameters I can change and see them reflected in AWE's traget info, except for Block size. I am thinking this might be the source of the memory problems, since my core is operating at 48 samples per block but the layout that is loaded on expects 32, and the hard fault happens the moment the layout loads onto the device.

sgarcia_1564
Offline
Last seen: 1 day 20 hours ago
Joined: 10/23/2017 - 6:43pm

This was easily solved by adding this to AWEInstanceInit() in Platform.c

awe_fwSetBlockSize(&g_AWEInstance, 48);​​​​​​​

​​​​​​​That is all that was needed to advertise to the AWE server the changed block size to 48 (different than the default 32 block size).

 

Andrew
Offline
Last seen: 1 week 1 day ago
Joined: 04/12/2018 - 9:25am

Hi Sal,

Sorry for the delay, but I am glad you were able to solve this! Let us know if you have any other questions. Thanks,

-Andrew P

sgarcia_1564
Offline
Last seen: 1 day 20 hours ago
Joined: 10/23/2017 - 6:43pm

I actually do have another question. Now that I have it set to 48, how do I increase it by a multiple of 48, say 96.

In the User Guide it states:

an application may be configured for a DMA size of 32-samples per block, while a signal-processing Layout in the AWE Core may be tuned to operate on blocks of 64, 128, 256, etc. This decoupling allows the DSP engineer to easily make tradeoffs between MIPs, memory, and latency without having to modify or rebuild the Application executable

How do I increase the "signal processing block size" without rebuilding the FW. I don't see any option for this in AWE Designer besides Buffer-Up Buffer-Down (which looks like are not available in the ST edition is that correct?), and there are various variable in your example FW for block size but all seem to relate to the DMA size, which I cannot change from 48 in my setup.

Andrew
Offline
Last seen: 1 week 1 day ago
Joined: 04/12/2018 - 9:25am

Hi Sal,

Now that you have set your fundamental blockSize to 48, you can change the signal processing blockSize of the layout via the Input Pin. 

  1. Right click the Input Pin and select "View Properties". The Module Properties panel will appear at the bottom. 
  2. Switch from the "Properties" tab to the "Build" tab.
  3. There is an editable field "blockSize". You can change that to a multiple of 48. 
  4. Click "Propagate Changes" and the new blockSize will be applied to the rest of your layout. 

Let me know if that helps!