This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

"create policy error" when creating an Event

Other Parts Discussed in Thread: MSP430WARE, MSP430F5636

Hello everybody,

I´m getting this error:

s.knl.Event: create policy error
xdc.runtime.Error.raise: terminating execution

when calling to the Event_create function.

I´ve been reading the forum and it is suggested to set the Enable Dynamic Instance Creation within the .cfg [SYS/BIOS] configuration file inside the Runtime options tab. I have done this already and I´m still getting the error. 

Information about my setup: I´m calling the Event_create function just right afther my main.c execution starts. My code is currently using 78% of the RAM, 22% FLASH and 26% FLASH2 and running on an MSP430F5636. I´m attaching a pic of my runtime config page within the .cfg file and a brief of my code. I´m using CCS version 6.0.1.00040, SYS/BIOS 6.40.1.15, TI-RTOS 2.1.0.03, MSP430 DriverLib 1.80.0.18 and MSP430ware 1.80.1.03.

Hope anybody can help out , thanks!

#include <string.h>
#include "driverlib.h"
#include "USB_config/descriptors.h"
#include "USB_API/USB_Common/device.h"         
#include "USB_API/USB_Common/usb.h"       

#include <ti/sysbios/BIOS.h>   // BIOS includes
#include <ti/sysbios/knl/Event.h>
#include <xdc/runtime/Error.h>

....
Event_Handle Event_RS485Receive;
....

void main(void)
{
	Event_RS485Receive = Event_create(NULL, NULL);
	Event_post(Event_RS485Receive, NO_RECEIVE);
        .....
}

 

  • Hi Nicolas,

    When you call a runtime kernel create function (e.g. Event_create), an object is allocated from heap. You have the Heap Size set to zero, so there is no heap. Try increasing the heap size to some value, maybe 256 to start.

    The other option is to create the Event in the graphical configuration tool also. Of course there is the trade-off of flexibility vs footprint when determining whether to create objects statically (graphical config tool) or dynamically (runtime APIs).

    Todd

  • Hi Todd,

    Thank you for the advice first of all, it helped a lot.

    However, just by changing the heap size, as you indicated, it didnt work either. Nor by using the graphical config tool (with heap size set to 0).
    What I had to do in order to make it work is to use the graphical config tool plus change the size of the heap (I used 1024), in this way it worked and I could create events successfully.

    For the moment I´m fine so I can keep working on this. But soon I´ll need to know how to fix this issue so I can use the API runtime kernel instead of the graphical config tool, How could we proceed to find out about this?

    Thanks again


    Nicolás Díez
  • Nicolás,

    Can you attach your .cfg file? I want to see how the kernel is set-up. There might be something else causing the issue.

    Todd

  • Hi Todd,

    Ok, I´m attachinh here my .cfg file.

    Nicolás D.

    0383.task.cfg

  • Why do you have the following lines in the .cfg

    Defaults.common$.memoryPolicy = xdc.module("xdc.runtime.Types").STATIC_POLICY;

    Event.common$.memoryPolicy = xdc.module("xdc.runtime.Types").STATIC_POLICY;

    When you the memoryPolicy to STATIC_POLICY, it is telling the module that there will be no dynamic runtime calls to XXX_create. This allows the module to builds itself in a way that reduces footprint.

    By having the Defaults module set to STATIC_POLICY, there can be no creates called by any module (unless you explicitly say it can...all modules inherit the Defaults unless explicit confogure). 

    Todd