Hi,
The examples provided with the ST library are coded for the ST evaluation cards, and you have to adapt the peripherals addresses (GPIO ports, number of pins...) declared in a header file ("stm3210e_eval.h" for example), for the Primer2, according to electrical drawings.